mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-12 16:17:29 +05:00
Workplane - finish wire without closing
This commit is contained in:
parent
eda914281a
commit
18c30805ab
@ -193,6 +193,17 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
auto Finish()
|
||||||
|
{
|
||||||
|
if (!startvertex.IsNull())
|
||||||
|
{
|
||||||
|
wires.push_back (wire_builder.Wire());
|
||||||
|
wire_builder = BRepBuilderAPI_MakeWire();
|
||||||
|
startvertex.Nullify();
|
||||||
|
}
|
||||||
|
return shared_from_this();
|
||||||
|
}
|
||||||
|
|
||||||
auto MoveTo (double h, double v)
|
auto MoveTo (double h, double v)
|
||||||
{
|
{
|
||||||
startpnt = gp_Pnt2d(h,v);
|
startpnt = gp_Pnt2d(h,v);
|
||||||
@ -248,7 +259,7 @@ public:
|
|||||||
OCCGeometry::global_shape_properties[edge.TShape()].name = name;
|
OCCGeometry::global_shape_properties[edge.TShape()].name = name;
|
||||||
wire_builder.Add(edge);
|
wire_builder.Add(edge);
|
||||||
|
|
||||||
if (closing) Close();
|
if (closing) Finish();
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,11 +372,8 @@ public:
|
|||||||
//update localpos.Direction()
|
//update localpos.Direction()
|
||||||
Rotate(angle*180/M_PI);
|
Rotate(angle*180/M_PI);
|
||||||
if (closing)
|
if (closing)
|
||||||
{
|
Finish();
|
||||||
cout << "call close from arc" << endl;
|
|
||||||
Close();
|
|
||||||
cout << "close is back" << endl;
|
|
||||||
}
|
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,26 +462,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
shared_ptr<WorkPlane> Close ()
|
shared_ptr<WorkPlane> Close ()
|
||||||
{
|
{
|
||||||
cout << "close called" << endl;
|
|
||||||
|
|
||||||
if (startpnt.Distance(localpos.Location()) > 1e-10)
|
if (startpnt.Distance(localpos.Location()) > 1e-10)
|
||||||
{
|
{
|
||||||
cout << "generate closing line" << endl;
|
|
||||||
LineTo (startpnt.X(), startpnt.Y());
|
LineTo (startpnt.X(), startpnt.Y());
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startvertex.IsNull())
|
if (!startvertex.IsNull())
|
||||||
{
|
Finish();
|
||||||
cout << "I am actually closing" << endl;
|
|
||||||
wires.push_back (wire_builder.Wire());
|
|
||||||
wire_builder = BRepBuilderAPI_MakeWire();
|
|
||||||
startvertex.Nullify();
|
|
||||||
cout << "complete" << endl;
|
|
||||||
}
|
|
||||||
cout << "close returning" << endl;
|
|
||||||
return shared_from_this();
|
return shared_from_this();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1613,6 +1612,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
.def("Offset", &WorkPlane::Offset)
|
.def("Offset", &WorkPlane::Offset)
|
||||||
.def("Reverse", &WorkPlane::Reverse)
|
.def("Reverse", &WorkPlane::Reverse)
|
||||||
.def("Close", &WorkPlane::Close)
|
.def("Close", &WorkPlane::Close)
|
||||||
|
.def("Finish", &WorkPlane::Finish)
|
||||||
.def("Last", &WorkPlane::Last)
|
.def("Last", &WorkPlane::Last)
|
||||||
.def("Face", &WorkPlane::Face)
|
.def("Face", &WorkPlane::Face)
|
||||||
.def("Wires", &WorkPlane::Wires)
|
.def("Wires", &WorkPlane::Wires)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user