def _add_point_from_corner(brep, builder, mesh, mesh_builder, corner_id): corner = brep.corner(corner_id) point = corner.mesh().point(0) vertex_id = brep.unique_vertex( model.MeshComponentVertex(corner.component_id(), 0)) new_vertex = mesh_builder.create_point(point) builder.set_unique_vertex( model.MeshComponentVertex(mesh.component_id(), new_vertex), vertex_id)
def _create_corner(brep, builder, point): corner_id = builder.add_corner() corner = brep.corner(corner_id) builder.corner_mesh_builder(corner_id).create_point(point) model_vertex_id = builder.create_unique_vertex() builder.set_unique_vertex( model.MeshComponentVertex(corner.component_id(), 0), model_vertex_id) return corner_id
def _corner_from_surface_vertex(brep, surface, vertex): vertex_id = brep.unique_vertex( model.MeshComponentVertex(surface.component_id(), vertex)) unique_vertices = brep.filtered_mesh_component_vertices_by_type( vertex_id, model.Corner3D.component_type_static()) return unique_vertices[0].component_id.id()