Preserve pcurves in TopoShapeEdge.split
This commit is contained in:
@@ -358,11 +358,11 @@ Part.show(s)
|
||||
split(paramval) -> Wire
|
||||
--
|
||||
Args:
|
||||
paramval (float or int): The parameter value along the Edge at which to
|
||||
paramval (float or list_of_floats): The parameter values along the Edge at which to
|
||||
split it e.g:
|
||||
|
||||
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
|
||||
y = x.derivative3At(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
|
||||
edge = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
|
||||
wire = edge.split([0.5, 1.0])
|
||||
|
||||
Returns:
|
||||
Wire: wire made up of two Edges
|
||||
|
||||
@@ -711,10 +711,16 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
|
||||
|
||||
BRepBuilderAPI_MakeWire mkWire;
|
||||
Handle(Geom_Curve) c = adapt.Curve().Curve();
|
||||
const TopoDS_Edge& edge = TopoDS::Edge(this->getTopoShapePtr()->getShape());
|
||||
BRep_Builder builder;
|
||||
TopoDS_Edge e;
|
||||
std::vector<Standard_Real>::iterator end = par.end() - 1;
|
||||
for (std::vector<Standard_Real>::iterator it = par.begin(); it != end; ++it) {
|
||||
BRepBuilderAPI_MakeEdge mkBuilder(c, it[0], it[1]);
|
||||
mkWire.Add(mkBuilder.Edge());
|
||||
BRepBuilderAPI_MakeEdge mke(c, it[0], it[1]);
|
||||
e = mke.Edge();
|
||||
builder.Transfert(edge, e);
|
||||
builder.Range(e, it[0], it[1], false);
|
||||
mkWire.Add(e);
|
||||
}
|
||||
|
||||
return new TopoShapeWirePy(new TopoShape(mkWire.Shape()));
|
||||
|
||||
Reference in New Issue
Block a user