Einfügen von anderen 3D Elementen in dxf2lib (nicht getestet)

This commit is contained in:
2025-12-15 13:31:08 +01:00
parent 61a04726fe
commit 7092d13280
2 changed files with 111 additions and 84 deletions
+27
View File
@@ -64,6 +64,10 @@ def create_block_library(input_dir, output_file, config, logger=None):
"ARC",
"INSERT",
"ATTDEF",
"3DFACE",
"MESH",
"POLYFACE",
"POLYFACEMESH",
"SURFACE",
"3DSURFACE",
"EXTRUDEDSURFACE",
@@ -490,6 +494,29 @@ def get_entity_bounding_box(e, doc,src_doc,filename,config, transform_matrix=Non
)
if ve_bbox.has_data:
bbox.extend(ve_bbox)
elif e.dxftype() == '3DFACE':
# 3DFace: direkte Eckpunkte verwenden
pts = []
try:
pts = [Vec3(p) for p in e.get_points()] # ezdxf API
except Exception:
try:
pts = [Vec3(v.dxf.location) for v in e.vertices]
except Exception:
pts = []
if transform_matrix:
pts = [transform_matrix.transform(p) for p in pts]
if pts:
bbox.extend(pts)
elif e.dxftype() in {'MESH', 'POLYFACE', 'POLYFACEMESH'}:
# Mesh/Polyface über virtuelle Geometrie auswerten
ve_bbox = _bbox_from_virtual_entities(
e, doc, src_doc, filename, config, transform_matrix
)
if ve_bbox.has_data:
bbox.extend(ve_bbox)
elif e.dxftype() == 'SPLINE':
# Approximation der Spline-Kurve