Form least square plane from selected points

Feel free to ask any question here
Post Reply
shunyo
Posts: 4
Joined: Fri Feb 08, 2013 2:19 pm

Form least square plane from selected points

Post 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.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Form least square plane from selected points

Post 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.
Daniel, CloudCompare admin
ucab127
Posts: 5
Joined: Wed Aug 27, 2014 8:38 am

Re: Form least square plane from selected points

Post 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
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Form least square plane from selected points

Post by daniel »

Can you be more specific? You want the equation under which form? ax + by + cz + d = 0?
Daniel, CloudCompare admin
ucab127
Posts: 5
Joined: Wed Aug 27, 2014 8:38 am

Re: Form least square plane from selected points

Post 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.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Form least square plane from selected points

Post 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).
Daniel, CloudCompare admin
ucab127
Posts: 5
Joined: Wed Aug 27, 2014 8:38 am

Re: Form least square plane from selected points

Post by ucab127 »

Just to confirm, there is not a way of exporting those coefficients at the moment?
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Form least square plane from selected points

Post 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 ;).
Daniel, CloudCompare admin
Post Reply