コード例 #1
0
 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())
コード例 #2
0
    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())
コード例 #3
0
ファイル: explore.py プロジェクト: tnakaicode/AFEM-OCC
    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
コード例 #4
0
 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())
コード例 #5
0
 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())