Working with open curveloops and short curves (less than 0.8mm)

Hey legends of the forum!

I’m struggling to connect these together to create a floor outline. I’m suspecting it’s the curve length that’s causing this issue. Is there a workaround for this? I’ve tried numerous methods including turning it into a surface and extracting the perimeter curves but no luck.

I believe the succeeding issue after that is… how do i create a floor with opening??
Similar topic as this post (Floor By Nested Loops) but it got deviated to filled regions. Multi curveloop has been a struggle to deal with.

Any pointers would be great.

Cheers,
J

Revit can’t draw or use very short lines as profile.
You have to merge or simplify profile lines.
this is my code for the work.
see attached

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
def direc(curve):#in case if not line(but straight curve)
	spt=curve.StartPoint
	ept=curve.EndPoint
	vec=Vector.ByTwoPoints(spt,ept)
	return vec
# Place your code below this line
lines=IN[0]
angle=IN[1]#minimum angle
minlength=IN[2]
points=[]
#collect useful points only
for i in range(len(lines)):
	if i<len(lines)-1:
		j=i+1
	else:
		j=0
	line0=lines[i]
	line1=lines[j]
	spt0=line0.StartPoint
	spt1=line1.StartPoint
	leg=spt0.DistanceTo(spt1)
	vec0=direc(line0)
	vec1=direc(line1)
	ang=vec0.AngleWithVector(vec1)
	if ang>=angle and leg>minlength:
		points.append(spt1)

#create useful lines
poly0=PolyCurve.ByPoints(points,True)
newlines=Geometry.Explode(poly0)
# Assign your output to the OUT variable.
OUT = newlines
4 Likes

Hi Hyunu_Kim,

Thanks for the assistance!
Unfortunately, I work with a lot of modelers and line control isn’t their best suit.
Just have to do what we do best. Workaround! :smiley:

I’ve tried to use the python script but I believe it doesn’t allow for a loop of elements in a L3 list.
Is there a way to tweak for that to work?
Still a bit new to the python environment so… i’m not too sure on how to control the input and output for a looping action.

Another method that I’ve found was to use either Synthesize or Spring node’s simplify to simplify the lines and arcs. That reduced the amount of <1mm lines derived from the closewithline node.

Using the synthesize package does reduce the amount of redundant lines by quite an amount but it’s relatively takes longer to compute.

It that case…you can make above python as a custom node and use it with List.Map
Or use below code.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
def direc(curve):#in case if not line(but straight curve)
	spt=curve.StartPoint
	ept=curve.EndPoint
	vec=Vector.ByTwoPoints(spt,ept)
	return vec
# Place your code below this line
lists=IN[0]#multiple lists of lines
angle=IN[1]#minimum angle
minlength=IN[2]
newlists=[]
#collect useful points only
for lines in lists:#run below for each list of lines
	points=[]
	for i in range(len(lines)):
		if i<len(lines)-1:
			j=i+1
		else:
			j=0
		line0=lines[i]
		line1=lines[j]
		spt0=line0.StartPoint
		spt1=line1.StartPoint
		leg=spt0.DistanceTo(spt1)
		vec0=direc(line0)
		vec1=direc(line1)
		ang=vec0.AngleWithVector(vec1)
		if ang>=angle and leg>minlength:
			points.append(spt1)
	
	#create useful lines
	poly0=PolyCurve.ByPoints(points,True)
	newlines=Geometry.Explode(poly0)#each of list of lines
	newlists.append(newlines)
# Assign your output to the OUT variable.
OUT = newlists #new list of lists of lines
1 Like

Just in case I got this right… This is my outcome.

what if the lines are really that bad and it has branching issues? :sweat_smile:

My last code is for a list contains lists of closed chain lines. like [[l1,l2,l3,l4…],[l11,l12,l13…]]
it will reduce unnecessary points(by measuring angle and length) and return new lines which maintain each chain.