It is currently Thu Feb 20, 2020 12:05 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Fri Jan 17, 2020 4:37 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5979
Location: Wales, UK
I'm working on integrating your code - on average, there are around 70 planes to define (mostly not displayed graphically, they are a means to an end - intersections. If User selection of planes is required, then symbolic square quad faces are displayed.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Sat Jan 18, 2020 9:14 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5979
Location: Wales, UK
Hi again alter Mann

I'm having a torrid time trying to separate the code into what is required to find the best fit plane and the code required to display/rotate/zoom the plane (which I don't need for the plane, it's one of many, but I would like to "recycle" that part of the code to allow the whole model to be rotated/zoomed).

As I understand it:
1) In Procedure Main, DATcalcSize(adPoints(),adMinMax(),adSP()) defines the Bounding Box of the points?
2) What does adSP() represent? The centroid of the points Bounding Box?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Sun Jan 19, 2020 11:28 am 
Offline
User
User

Joined: Fri Oct 17, 2014 8:52 pm
Posts: 34
adMinMax ist the bounding box. adSP is the centroid of all data points. This is not the same as the centroid of the bouning box. The centroid is part of the best-fit plane (see the article you linked above).
adMP is the centroid of the bounding box.
CalcMat calculates the matrix, according to which the eigenvectors and the eigenvalues ​​are calculated. The eigenvector of the minimum of the eigenvalues shows the plane normal vector (also explained in the article).
Hope this help you a little bit.


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Thu Feb 13, 2020 8:00 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4591
Location: Spa, relaxing and thinking, and learning...
Interesting problem.
I would proceed in this manner:
Get the 'n' points (3D vectors really).
Get 3 groups (n/3), if 'n' is 40 for example: then 1 group from 13, other 13, and other 14. The groups are obtained randomly i.e. never mind what points.
Locate the "center of masses" from each group, for example for first group would be the arithmetic mean: ' v1+v2+v3... / 13 ' , where v1, v2, etc. are the points (vectors).
So you have now 3 points to build the wanted plane.

Repeat that algorithm adding to the 'n' those above 3 points, and using now a Weighted_arithmetic_mean (https://en.wikipedia.org/wiki/Weighted_arithmetic_mean) giving to the 3 points a bigger "weigth" than the others.

Repeat again. So you will get 46, and the weight for the 3 points is now still bigger.

Repeat again.

The more loops the more accurate plane will obtain.

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Wed Feb 19, 2020 1:55 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5979
Location: Wales, UK
Hi Psychophanta - I did experiment with a similar method before, but it was not waif and stray proof enough for my purpose. However, it would not be unusual for the cause of failure to be my implementation rather than the method :wink:

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Wed Feb 19, 2020 6:17 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5979
Location: Wales, UK
Hi alter Mann

Until now, I have not paid attention to the plane's normal direction, but I discovered I have made errors by not taking it into consideration. :(

In the best-fit plane code, can I define the normal direction?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Procedure to define a best-fit Plane through a set of po
PostPosted: Wed Feb 19, 2020 9:54 pm 
Offline
User
User

Joined: Fri Oct 17, 2014 8:52 pm
Posts: 34
The point set does not define one direction of the plane but both, the calculated direction (adV()) and the opposite direchtion (-adV(0),-adV(1),-adV(2)). To choose one of both you need additional information.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye