Grasshopper

algorithmic modeling for Rhino

I'm fairly new to python. And, I'm not familiar with the decomposition of point list. How would I be able to take a list of random points in a r^2 plane, and decompose them into x and y list? 

I need the point coordinates for an inclusion formula. 

Thanks in advance! 

Views: 1408

Replies to This Discussion

Hi Kevin,

i don't understand exactly what you mean by r^2 plane but i guess you want to remap the points in world space to a certain plane so that z-coordinates are zeroed out and you can use x,y coordinates related to that plane origin.

In the example Attached you see how this could be done in python. In addition the Test for PointContainment with a closed curve on that plane. I hope this helps:

1)

result = Pl.RemapToPlaneSpace(P)

if result[0]:

    x = result[1].X

    y = result[1].Y

2)

import Rhino.Geometry.PointContainment as PointContainment

a = C.Contains(P, C.TryGetPlane()[1], 0.01) == PointContainment.Inside

cheers,

FF

Attachments:

Thanks very much! I'll check it out! 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service