Part: add method to add a wire (e.g. to create a hole) to a face
This commit is contained in:
@@ -374,6 +374,45 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief TopoShapeFacePy::addWire
|
||||
* \code
|
||||
circle = Part.Circle()
|
||||
circle.Radius = 10
|
||||
wire = Part.Wire(circle.toShape())
|
||||
Part.show(wire)
|
||||
|
||||
circle2 = Part.Circle()
|
||||
circle2.Radius = 4
|
||||
wire2 = Part.Wire(circle2.toShape())
|
||||
Part.show(wire2)
|
||||
|
||||
plane = Part.Plane()
|
||||
face = plane.toShape()
|
||||
|
||||
face.addWire(wire)
|
||||
face.Area
|
||||
Part.show(face)
|
||||
|
||||
face.addWire(wire2.reversed())
|
||||
face.Area
|
||||
Part.show(face)
|
||||
* \endcode
|
||||
*/
|
||||
PyObject* TopoShapeFacePy::addWire(PyObject *args)
|
||||
{
|
||||
PyObject* wire;
|
||||
if (!PyArg_ParseTuple(args, "O!", &TopoShapeWirePy::Type, &wire))
|
||||
return nullptr;
|
||||
|
||||
BRep_Builder aBuilder;
|
||||
TopoDS_Face face = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
const TopoDS_Shape& shape = static_cast<TopoShapeWirePy*>(wire)->getTopoShapePtr()->getShape();
|
||||
aBuilder.Add(face, shape);
|
||||
getTopoShapePtr()->setShape(face);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* TopoShapeFacePy::makeOffset(PyObject *args)
|
||||
{
|
||||
double dist;
|
||||
|
||||
Reference in New Issue
Block a user