Beispiel #1
0
 def draw_mesh_entity(self, entity: DXFGraphic,
                      properties: Properties) -> None:
     builder = MeshBuilder.from_mesh(entity)
     self.draw_mesh_builder_entity(builder, properties)
Beispiel #2
0
 def draw_mesh_entity(self, entity: DXFGraphic) -> None:
     properties = self._resolve_properties(entity)
     builder = MeshBuilder.from_mesh(entity)
     self.draw_mesh_builder_entity(builder, properties)
Beispiel #3
0
 def _convert_entity(self):
     self._mesh = MeshBuilder.from_mesh(self.entity)
Beispiel #4
0
    (1, 0, 1),
    (1, 1, 1),
    (0, 1, 1),
]

# 6 cube faces
cube_faces = [
    [0, 3, 2, 1],
    [4, 5, 6, 7],
    [0, 1, 5, 4],
    [1, 2, 6, 5],
    [3, 7, 6, 2],
    [0, 4, 7, 3],
]

doc = ezdxf.new("R2018")
msp = doc.modelspace()
mesh = msp.add_mesh(dxfattribs=GfxAttribs(color=6))
with mesh.edit_data() as mesh_data:
    mesh_data.vertices = cube_vertices
    mesh_data.faces = cube_faces

# Add the same mesh as PolyFaceMesh:
mesh_builder = MeshBuilder.from_mesh(mesh)
mesh_builder.render_polyface(
    msp,
    dxfattribs=GfxAttribs(color=6),
    matrix=Matrix44.translate(5, 0, 0),
)
doc.saveas(DIR / "cube_mesh_1.dxf")