Einfügen von anderen 3D Elementen in dxf2lib (nicht getestet)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user