occt: add point wrapper to create, delete and get coordinates

This commit is contained in:
2025-11-08 17:32:17 +01:00
parent 2cb95de51b
commit 09a410e7ac
2 changed files with 32 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#include <gp_Pnt.hxx>
Point* make_point(double x, double y, double z) {
gp_Pnt* p = new gp_Pnt(x, y, z);
return reinterpret_cast<Point*>(p);
}
void free_point(Point* p) {
delete reinterpret_cast<gp_Pnt*>(p);
}
void coord_point(const Point* p, double* x, double* y, double* z) {
const gp_Pnt* gp = reinterpret_cast<const gp_Pnt*>(p);
*x = gp->X();
*y = gp->Y();
*z = gp->Z();
}