2004-05-24 04:15 PM - last edited on 2023-08-07 12:23 PM by Doreena Deng
API_Component3D component; long j, nVertices, nEdges, nPolygons; GSErrCode err; BNZeroMemory (&component, sizeof (component)); component.header.typeID = API_BodyID; component.header.index = ibody; ACAPI_3D_GetComponent (&component); nVertices = component.body.nVert; nEdges = component.body.nEdge; nPolygons = component.body.nPgon;and then I step through all polygons:
for (j = 1; j <= nPolygons; j++) { component.header.typeID = API_PgonID; component.header.index = j; ACAPI_3D_GetComponent(&component); long firstEdge, lastEdge; firstEdge = component.pgon.fpedg; lastEdge = component.pgon.lpedg; // Walk through the edges for (long e = firstEdge; e < lastEdge; e++) { component.header.typeID = API_PedgID; component.header.index = e; ACAPI_3D_GetComponent(&component); // get the edge API_PedgType &edge = ?????????? } }I'm not sure if I'm doing this correct, but I did this in about the same way as stepping through the other elements. So how do I get the list of vertices that is used in one particular polygon?
2004-06-02 07:40 PM
Ralph wrote:Well done, Ralph! Exactly the point of abstraction... and I wonder (not that we'll ever know) if GS themselves do this with their own add-ons, but just don't make the wrappers available to us...
Oleg is correct regarding the efficiencies of the internal implementation. I also agree with your observation regarding a wrapper class - I have implemented classes for this very purpose. It was more time-consuming to write up-front, but the long-term gain through ease of use has made it worthwhile. Very efficient too. The other main benefit is that we won't suffer so much if the API for this data changes - the differences should be absorbed by the wrapper and not everything based on it.
2004-06-03 10:47 AM
Karl wrote:Some parts of GS do, but the main add-on development doesn't. This is due to a lot of legacy code and code from external developers we have here, and the lack of time to modernize/unify those.
and I wonder (not that we'll ever know) if GS themselves do this with their own add-ons, but just don't make the wrappers available to us...
Karl
2004-06-04 07:05 AM
Akos wrote:Good to see you here, Akos! I would say "welcome", but Djordje would tell me that I can't welcome you to your own forum...but welcome, anyway.
Some parts of GS do, but the main add-on development doesn't. This is due to a lot of legacy code and code from external developers we have here, and the lack of time to modernize/unify those.
2004-06-04 08:30 AM
Karl wrote:Thanks for that. It's good to see that the forum is in good hands!
Good to see you here, Akos! I would say "welcome", but Djordje would tell me that I can't welcome you to your own forum...but welcome, anyway.😉
The situation sounds not so unusual ...
Best regards,
Karl