Page 1 of 1

Form least square plane from selected points

Posted: Fri Feb 08, 2013 2:25 pm
by shunyo
Hi,
I wanted to get the planar parameters of a least squares fit plane from a selection of three points. I am able to select the points into a point picking list but am not able to extract a plane from the points.
Similarly I have some planar parameters for some planes that I have extracted. Is it possible to render the planes in CloudCompare? If yes, what is the procedure? I have started using the software very recently and am not familiar with all the functionalities,
Thank you.

Re: Form least square plane from selected points

Posted: Fri Feb 08, 2013 3:08 pm
by daniel
Hi,

To get a 'plane' from 3 points (I'm not sure we can talk about least squares in this particular case) there's multiple (indirect) ways:
- you can use the 'Point picking' tool and then select the 3rd small icon that appear on the top-right part of the 3D view ("Select 3 points..."). Once you have picked the 3 points, CC will draw the corresponding triangle with a particular label. You can save it by clicking again on the small 'floppy' icon (still in the top-right part of the 3D view). You won't get the plane equation as is, but you'll get the 'plane' normal and 3 points in this plane.

- alternatively, you can use the 'Tools > Other > Plane orientation' tool (this is a true 'least square' fitting)
  • either on a whole point cloud or a part of it if you segment it manually before, for instance with the interactive segmentation tool (scissors icon)
  • or by using the 'Point list picking' tool to pick your 3 points and then export it as new cloud
There's no simple way to add a custom plane right now. You could use the point 'Plane orientation' tool on a fake set of points (describing a plane in the XY plane) then apply a transformation on the resulting plane primitive... (with Edit > Apply Transformation).

It reminds me that we should add a simple way to 'manually' add primitives in CC.

Re: Form least square plane from selected points

Posted: Wed Dec 03, 2014 12:25 pm
by ucab127
Can I just check that there isn't a direct way of getting the plan equation (from a plane fitted to a point cloud) within the software?

Many thanks

Re: Form least square plane from selected points

Posted: Wed Dec 03, 2014 1:11 pm
by daniel
Can you be more specific? You want the equation under which form? ax + by + cz + d = 0?

Re: Form least square plane from selected points

Posted: Wed Dec 03, 2014 2:31 pm
by ucab127
Yes. I realise it can be derived from exporting the plane, but I was wondering if I can get it in the equation form you've written above.

Re: Form least square plane from selected points

Posted: Wed Dec 03, 2014 3:14 pm
by daniel
In fact when we compute the plane we actually store the a,b,c and d coefficients. We simply don't display them (would be easy however).

Re: Form least square plane from selected points

Posted: Mon Dec 08, 2014 11:05 am
by ucab127
Just to confirm, there is not a way of exporting those coefficients at the moment?

Re: Form least square plane from selected points

Posted: Mon Dec 08, 2014 12:30 pm
by daniel
Right now no.

But it's a single line of code to add to the Fit > Plane method (if you can compile the project of course ;).