def __init__(self, p1, p2): # Build p1 = CheckGeom.to_point(p1) p2 = CheckGeom.to_point(p2) builder = BRepBuilderAPI_MakeEdge(p1, p2) self._e = Edge(builder.Edge()) self._v1 = Vertex(builder.Vertex1()) self._v2 = Vertex(builder.Vertex2())
def manifold_edges(self): """ :return: Manifold edges. :rtype: list(afem.topology.entities.Edge) """ edges = [] for i in range(1, self.n_free_edges + 1): e = Edge(self._tool.ContigousEdge(i)) edges.append(e) return edges
def multiple_edges(self): """ :return: Multiple edges. :rtype: list(afem.topology.entities.Edge) """ edges = [] for i in range(1, self.n_free_edges + 1): e = Edge(self._tool.MultipleEdge(i)) edges.append(e) return edges
def __init__(self, *edges): # Build builder = BRepBuilderAPI_MakeWire() for e in edges: if e is not None and not e.is_null and e.is_edge: builder.Add(e.object) self._w = Wire(builder.Wire()) self._last_e = Edge(builder.Edge()) self._last_v = Vertex(builder.Vertex())
def __init__(self, wire, face=None): if face is None: explorer = BRepTools_WireExplorer(wire.object) else: explorer = BRepTools_WireExplorer(wire.object, face.object) edges = [] current_verts = [] while explorer.More(): ei = Edge(explorer.Current()) vi = Vertex(explorer.CurrentVertex()) edges.append(ei) current_verts.append(vi) explorer.Next() # CurrentVertex doesn't get the last vertex. Try to get it. ordered_verts = list(current_verts) if edges: vi = Vertex(explorer.CurrentVertex()) ordered_verts.append(vi) self._edges = edges self._current_verts = current_verts self._ordered_verts = ordered_verts
def __init__(self, edge, v): v = CheckGeom.to_vector(v) builder = BRepPrimAPI_MakePrism(edge.object, v) self._f = Face(builder.Shape()) self._e1 = Edge(builder.FirstShape()) self._e2 = Edge(builder.LastShape())
def __init__(self, wire): self._e = Edge(brepalgo.ConcatenateWireC0(wire.object))
def __init__(self, vertex, v): v = CheckGeom.to_vector(v) builder = BRepPrimAPI_MakePrism(vertex.object, v) self._e = Edge(builder.Shape()) self._v1 = Vertex(builder.FirstShape()) self._v2 = Vertex(builder.LastShape())
def __init__(self, crv): # Build builder = BRepBuilderAPI_MakeEdge(crv.object) self._e = Edge(builder.Edge()) self._v1 = Vertex(builder.Vertex1()) self._v2 = Vertex(builder.Vertex2())
def __init__(self, v1, v2): # Build self._e = Edge(BRepBuilderAPI_MakeEdge(v1.object, v2.object).Edge())
def __init__(self, wire): self._e = Edge(BRepAlgo.ConcatenateWireC0_(wire.object))