CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
283 stars 40 forks source link

Extract plane equation from RANSAC_SD plugin #74

Open HollowHeartNet opened 1 year ago

HollowHeartNet commented 1 year ago

Hi,

how can I extract the plane equation from RANSAC_SD plugin for planar primitives?

Best, HollowHeartNet

prascle commented 1 year ago

Hi, The computeRANSAC_SD function from RANSAC_SD plugin gives as a result a tuple (list of primitive meshes, list of clouds). See test035.py for an example of use. For each type of primitive (plane, sphere, cylinder,..) it is possible to get the parameters of the equation. A plane is identified with mesh.isA((cc.CC_TYPES.PLANE) For the plane primitive, the method getEquation() returns the 4 coefficients of the plane equation: [a, b, c, d] as ax+by+cz=d The documentation is a bit light on this part, I will add an example! Regards, Paul

HollowHeartNet commented 1 year ago

Hi, Thank you! Best, HollowHeartNet