Replies: 1 comment
-
I figured it out. Rotation happen around the 0, 0, 0 coordinate. Therefore the issue lies with the translation matrices. I first have to translate the object that's to be rotated to 0, 0, 0, rotate it, and then translate it back to its original position. The working chain of matrices looks like this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all: thank you very much Mozman for this awesom library and maintaining it!
I'm working on a script that reads a Text.dxf file, converts its text to lines, keeps the texts size and rotation as well as the insertion points. What works so far is converting the text to lines, keeping the size and rotating the text. What I'm struggling with, are the insertion points.
Can anybody help me? Or point me in a direction?
`import pathlib
import math
import ezdxf
from ezdxf.addons import text2path
from ezdxf.gfxattribs import GfxAttribs
from ezdxf.fonts import fonts
from ezdxf.math import Matrix44
from ezdxf import zoom, path
CWD = pathlib.Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
CWD = pathlib.Path(".")
def extract_text_and_positions(input_file):
text_content = [] # Text entities
positions = [] # Positions of text entities
heights = [] # Height of text entities
rotations = [] # Rotation angle of text entities
def text_to_boundry_lines(text_content, positions, heights, rotations):
doc = ezdxf.new()
msp = doc.modelspace()
FONT = fonts.FontFace(family="Arial")
def polylines_to_lines(polyline, output_file):
msp = doc.modelspace()
output_doc = ezdxf.new()
output_msp = output_doc.modelspace()
if name == "main":
# Specify the input DXF file path
input_dxf_file = "Text.dxf"
output_file_path = "ConvertedText.dxf"
Beta Was this translation helpful? Give feedback.
All reactions