diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index e82fea92..309cc322 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -373,7 +373,7 @@ namespace netgen int facenr = 0; - int edgenr = mesh.GetNSeg(); + // int edgenr = mesh.GetNSeg(); (*testout) << "faces = " << geom.fmap.Extent() << endl; int curr = 0; @@ -468,7 +468,6 @@ namespace netgen cof = BRep_Tool::CurveOnSurface (edge, face, s0, s1); int geomedgenr = geom.emap.FindIndex(edge); - NgArray mp; NgArray params; @@ -522,12 +521,13 @@ namespace netgen for (size_t i = 1; i <= mp.Size()+1; i++) { - edgenr++; + // edgenr++; Segment seg; seg[0] = pnums[i-1]; seg[1] = pnums[i]; - seg.edgenr = edgenr; + // seg.edgenr = edgenr; + seg.edgenr = geomedgenr; seg.si = facenr; seg.epgeominfo[0].dist = params[i-1]; seg.epgeominfo[1].dist = params[i]; diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 5448803e..a180d975 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -365,7 +365,8 @@ DLL_HEADER void ExportNgOCC(py::module &m) case TopAbs_FACE: BRepGProp::SurfaceProperties (shape, props); break; default: - throw Exception("Properties implemented only for FACE"); + BRepGProp::LinearProperties(shape, props); + // throw Exception("Properties implemented only for FACE"); } double mass = props.Mass(); gp_Pnt center = props.CentreOfMass(); @@ -385,6 +386,12 @@ DLL_HEADER void ExportNgOCC(py::module &m) OCCGeometry::global_shape_names[e.Current().TShape()] = name; return shape; }) + + .def_property("name", [](const TopoDS_Shape & self) { + return OCCGeometry::global_shape_names[self.TShape()]; + }, [](const TopoDS_Shape & self, string name) { + OCCGeometry::global_shape_names[self.TShape()] = name; + }) .def_property("col", [](const TopoDS_Shape & self) { auto it = OCCGeometry::global_shape_cols.find(self.TShape());