Hi Reinhard,
So far looks good to me.
If you have any questions, no problem. If not too difficult i always try to provide info.
To inform.
I am trying to write a little c++ library.
The main goal is to provide some math functions for 3d.
Like finding intersection points. Trim objects etc for 3d geometry.
The idea came up when i was reverse engineering Draftsight with Ghidra and Ida past week.
I looked at the Api of Draftsight with Ghidra & Ida.
There are no secrets when opening a Elf file with these powerfull programs. image missing /media/kunena/emoticons/ermm.png
For now i came up with the example below, you can see a "Object" is created.
I like the idea that the Object is capable of intersecting different types on it's own. Like intersecting arc with line etc.
Also i came up with the idea of subclassing the gp_Pnt to gp_PntVec to create a array on the fly.
Code:
OBJECT *lineA = new OBJECT();
lineA->setType(TYPE::line);
lineA->setPoints({{0,50,0},{100,50,0}});
occt_viewer->show_shape(lineA->getShape());
OBJECT *lineB = new OBJECT();
lineB->setType(TYPE::line);
lineB->setPoints({{50,0,0},{50,100,0}});
occt_viewer->show_shape(lineB->getShape());
gp_PntVec pvec;
lineA->getIntersections(*lineB,pvec);
pvec.push_back({100,1,1}); // To show the gp_Pnt vector usage.
pvec.print();
Output :
gp_PntVec at i:0 Value x: 50.000000 y: 50.000000 z: 0.000000
gp_PntVec at i:1 Value x: 100.000000 y: 1.000000 z: 1.000000