add methods firstVertex and lastVertex to TopoEdge
This commit is contained in:
@@ -69,7 +69,25 @@
|
||||
<UserDocu>Set the tolerance for the edge.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="discretize" Const="true" Keyword="true">
|
||||
<Methode Name="firstVertex">
|
||||
<Documentation>
|
||||
<UserDocu>Vertex = firstVertex(Orientation=False)
|
||||
Returns the Vertex of orientation FORWARD in this edge.
|
||||
If there is none a Null shape is returned.
|
||||
Orientation = True : taking into account the edge orientation
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="lastVertex">
|
||||
<Documentation>
|
||||
<UserDocu>Vertex = lastVertex(Orientation=False)
|
||||
Returns the Vertex of orientation REVERSED in this edge.
|
||||
If there is none a Null shape is returned.
|
||||
Orientation = True : taking into account the edge orientation
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="discretize" Const="true" Keyword="true">
|
||||
<Documentation>
|
||||
<UserDocu>Discretizes the edge and returns a list of points.
|
||||
The function accepts keywords as argument:
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
# include <gp_Hypr.hxx>
|
||||
# include <gp_Parab.hxx>
|
||||
# include <gp_Lin.hxx>
|
||||
# include <TopExp.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <TopoDS_Shape.hxx>
|
||||
# include <TopoDS_Edge.hxx>
|
||||
@@ -668,6 +669,26 @@ PyObject* TopoShapeEdgePy::setTolerance(PyObject *args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* TopoShapeEdgePy::firstVertex(PyObject *args)
|
||||
{
|
||||
PyObject* orient = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "|O!", &PyBool_Type, &orient))
|
||||
return 0;
|
||||
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
|
||||
TopoDS_Vertex v = TopExp::FirstVertex(e, PyObject_IsTrue(orient) ? Standard_True : Standard_False);
|
||||
return new TopoShapeVertexPy(new TopoShape(v));
|
||||
}
|
||||
|
||||
PyObject* TopoShapeEdgePy::lastVertex(PyObject *args)
|
||||
{
|
||||
PyObject* orient = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "|O!", &PyBool_Type, &orient))
|
||||
return 0;
|
||||
const TopoDS_Edge& e = TopoDS::Edge(getTopoShapePtr()->getShape());
|
||||
TopoDS_Vertex v = TopExp::LastVertex(e, PyObject_IsTrue(orient) ? Standard_True : Standard_False);
|
||||
return new TopoShapeVertexPy(new TopoShape(v));
|
||||
}
|
||||
|
||||
// ====== Attributes ======================================================================
|
||||
|
||||
Py::Float TopoShapeEdgePy::getTolerance(void) const
|
||||
|
||||
Reference in New Issue
Block a user