mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
add norm of gp_Vec
This commit is contained in:
parent
36ac5e5bcc
commit
06f35594c6
@ -76,6 +76,8 @@ DLL_HEADER void ExportNgOCCBasic(py::module &m)
|
||||
.def_property("x", [](gp_Vec&p) { return p.X(); }, [](gp_Vec&p,double x) { p.SetX(x); })
|
||||
.def_property("y", [](gp_Vec&p) { return p.Y(); }, [](gp_Vec&p,double y) { p.SetY(y); })
|
||||
.def_property("z", [](gp_Vec&p) { return p.Z(); }, [](gp_Vec&p,double z) { p.SetZ(z); })
|
||||
.def("Norm", [](const gp_Vec& v)
|
||||
{ return v.Magnitude(); })
|
||||
.def("__str__", [] (const gp_Vec & p) {
|
||||
stringstream str;
|
||||
str << "(" << p.X() << ", " << p.Y() << ", " << p.Z() << ")";
|
||||
|
@ -769,7 +769,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
trafo.SetTranslation(v);
|
||||
BRepBuilderAPI_Transform builder(shape, trafo, true);
|
||||
PropagateProperties(builder, shape, occ2ng(trafo));
|
||||
return builder.Shape();
|
||||
return CastShape(builder.Shape());
|
||||
// version 2: change location
|
||||
// ...
|
||||
}, py::arg("v"), "copy shape, and translate copy by vector 'v'")
|
||||
|
Loading…
Reference in New Issue
Block a user