Grasshopper

algorithmic modeling for Rhino

Let's say I have 4 points p,q,r,s what is the syntax for applying thepoints3d.arepointscoplanar method to test for coplanar?

I can do it with straight vector math but looking for a programming solution.

My apologies in advance for the newbie programmer question.

Thx

Views: 371

Replies to This Discussion

Rhino.Geometry.Plane.FitPlaneToPoints()

 

This function has two overloads (i.e. the same function name but with different parameters). One of the overloads allows you to pass in a Double that will be filled out by the function. This Double will contain the maximum deviation for the Plane fit result. If this deviation is larger than your planarity tolerance, then the points are not co-planar.

 

This works for any number of points, so you'll need to put p, q, r & s into a collection of sorts:

 

Dim pf As Plane        

Dim dev As Double        

Dim rc As PlaneFitResult = Plane.FitPlaneToPoints(New Point3d() {p, q, r, s}, pf, dev)        

If (dev <= tolerance) Then          

  'Hurray!        

Else          

  'Boo!        

End If

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

thank you David and thanks so much for the explanation.

 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service