Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5800

Delete lines that intersect a plane

$
0
0

@odbc wrote:

Hi, I’m trying to add a function to the below script that creates lines from one point to all other points in my 3d scene. The function is to not create lines, or delete lines, that intersect a plane. Or even a new code that deletes lines that intersect any plane in my scene. Any ideas? Here’s the script I have for the lines from a point.

import rhinoscriptsyntax as rs

def createLines():
    point1 = rs.GetObject("Select the first point", 1, preselect=True)
    p1 = rs.coerce3dpoint(point1)
    rs.EnableRedraw(False)
    if point1:
        other_points = rs.ObjectsByType(1)
        for id in other_points:
            if id != point1:
                    rs.AddLine(p1, rs.coerce3dpoint(id))
    rs.EnableRedraw(True)


createLines()

Now, I’m trying to add the function of either:
once created, delete those lines that intersect with the planes in my model
or
if id != point1:
AND if path doesnt intersect planes
addLine

Let me know if I need to be more clear.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5800

Trending Articles