Forgot password?

Create an account!

Forum

« back

RhinoScript – Compare planes

Messages

Please log in to write a message.

  • 6. citro (Apr 12, 2009 14.28):

    thx:)

  • 5. Hanno (Apr 04, 2009 11.32):

    if you have a tolerance problem, try to "loosen" your comparison:
    use something like

    a - b < 1.0e-12

    instead of

    a = b
  • 4. citro (Apr 02, 2009 20.36):

    Hi Hannoi,

    I still have a problem, its like the is a kind tolerance problem. When i compare planes by coefficient it still takes a couple of co planar with the sort array. Any tips? as before i need an array with the plans only existing ones.
    For i = 0 To UBound(plane1)

    Check = False

    If (IsArrayDimmed(Sortplanes) = False) Then
    N = n+1

    ReDim Preserve Sortplanes(n)
    Sortplanes(n) = plane1(i)
    End If

    If (IsArrayDimmed(sortplanes)= True) Then


    For j = 0 To Ubound(sortplanes)
    SortEq = Rhino.PlaneEquation(Sortplanes(j))
    PlaneEq = Rhino.PlaneEquation(plane1(i))



    'Call Rhino.Print(CStr(Ubound(Sortplanes)))
    'Call Rhino.Print(CStr(Ubound(Plane1)))
    If SortEq(0)= PlaneEq(0) And SortEq(1) = PlaneEq(1) And SortEq(2)= PlaneEq(2) And SortEq(3)= PlaneEq(3) Then

    Check = False

    Exit For
    ElseIf Not SortEq(0) = PlaneEq(0) And Not SortEq(1) = PlaneEq(1) And Not SortEq(2) = PlaneEq(2) And Not SortEq(3) = PlaneEq(3)Then
    Check = True



    End If

  • 3. citro (Mar 26, 2009 23.36):

    Hi Hannoi

    Thx for the help again, I found the points by inserting them in the planeequation, yes that would be like distancetoplane:( the tolerance tricked alot, because it wouldn't be perfectly 0,)

    But i now a comparing plan by insecting a point from another plane to check if it lies on the testingplane. But i will try to compare the planar equations instead.

    Thx :)

  • 2. Hanno (Mar 24, 2009 17.55):

    Hi,

    planes consist of an origin and 3 direction vectors. You can use PointCompare() to check if some planes are the same (be sure to unitize your vectors).
    Even easier could be to use PlaneEquation() and then compare the coefficients.

    For the point check you can use DistanceToPlane() - if the result is 0 (or better: below your tolerance), the point lies on the plane.

    Hope that helps!

    Hanno

  • 1. citro (Mar 22, 2009 16.13):

    Any body got an idea
    If you got an array with planes where many of them are the same.
    How to compare planes and sort them?

    And afterward find points that lies on the plane?

    Anyway thx

Recommend

Why are these buttons gray?