Skip to content

Commit

Permalink
AddPoint with attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
StudioWEngineers committed Dec 16, 2024
1 parent 150099d commit 88af31f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/bindings/bnd_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,13 @@ BND_UUID BND_ONXModel_ObjectTable::AddPoint1(double x, double y, double z)
return ON_UUID_to_Binding(rc);
}

BND_UUID BND_ONXModel_ObjectTable::AddPoint6(double x, double y, double z, const BND_3dmObjectAttributes* attributes)
{
ON_Point point_geometry(x,y,z);
ON_UUID rc = Internal_ONX_Model_AddModelGeometry(m_model.get(), &point_geometry, attributes);
return ON_UUID_to_Binding(rc);
}

BND_UUID BND_ONXModel_ObjectTable::AddPointCloud(const BND_PointCloud& cloud, const BND_3dmObjectAttributes* attributes)
{
const ON_Geometry* g = cloud.GeometryPointer();
Expand Down Expand Up @@ -1705,8 +1712,11 @@ void initExtensionsBindings(rh3dmpymodule& m)
.def("__iter__", [](py::object s) { return PyBNDIterator<BND_ONXModel_ObjectTable&, BND_FileObject*>(s.cast<BND_ONXModel_ObjectTable &>(), s); })
#endif
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint1, py::arg("x"), py::arg("y"), py::arg("z"))
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint6, py::arg("x"), py::arg("y"), py::arg("z"), py::arg("attributes"))
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint2, py::arg("point"))
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint3, py::arg("point"), py::arg("attributes"))
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint4, py::arg("point"))
.def("AddPoint", &BND_ONXModel_ObjectTable::AddPoint5, py::arg("point"), py::arg("attributes"))
.def("AddPointCloud", &BND_ONXModel_ObjectTable::AddPointCloud, py::arg("cloud"), py::arg("attributes")=nullptr)
.def("AddLine", &BND_ONXModel_ObjectTable::AddLine1, py::arg("from"), py::arg("to"))
.def("AddPolyline", &BND_ONXModel_ObjectTable::AddPolyline1, py::arg("polyline"), py::arg("attributes")=nullptr)
Expand Down
5 changes: 3 additions & 2 deletions src/bindings/bnd_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ class BND_ONXModel_ObjectTable
public:
BND_ONXModel_ObjectTable(std::shared_ptr<ONX_Model> m) { m_model = m; }
BND_UUID AddPoint1(double x, double y, double z);
BND_UUID AddPoint6(double x, double y, double z, const class BND_3dmObjectAttributes* attributes);
BND_UUID AddPoint2(const ON_3dPoint& point) { return AddPoint1(point.x, point.y, point.z); }
//Guid AddPoint3(Point3d point, DocObjects.ObjectAttributes attributes)
BND_UUID AddPoint3(const ON_3dPoint& point, const class BND_3dmObjectAttributes* attributes) { return AddPoint6(point.x, point.y, point.z, attributes); }
BND_UUID AddPoint4(const ON_3fPoint& point) { return AddPoint1(point.x, point.y, point.z); }
//Guid AddPoint5(Point3f point, DocObjects.ObjectAttributes attributes)
BND_UUID AddPoint5(const ON_3fPoint& point, const class BND_3dmObjectAttributes* attributes) { return AddPoint6(point.x, point.y, point.z, attributes); }
//Guid[] AddPoints1(IEnumerable<Point3d> points)
//Guid[] AddPoints2(IEnumerable<Point3d> points, DocObjects.ObjectAttributes attributes)
//Guid[] AddPoints3(IEnumerable<Point3f> points)
Expand Down

0 comments on commit 88af31f

Please sign in to comment.