Anybody have a Linetype for Fencing? Looks sort of like this :
I got that from a Vectorworks user. It comes in as just a block of crvs. So that’s another question – how to get Linetypes from other platforms if people are willing to share with you?
Anybody have a Linetype for Fencing? Looks sort of like this :
As far as I know lines in Rhino can only be continuous or dashed. This pattern could probably be made with a hatch pattern, but that requires you to turn lines into thin strips and will only work with orthogonal lines. If you are fine with multiple lines then this is fairly easy to script.
like this:
import rhinoscriptsyntax as rs
import scriptcontext as sc
def fenceCurve():
"""
---x---x---x---x---x---x---
this script divides a curve by length and adds 'crosses' to it, grouped per curve / polyline
www.studiogijs.nl
"""
curves = rs.GetObjects("select curves to change into fence-style",4, preselect=True)
if not curves:
return
s=sc.sticky['scale'] if sc.sticky.has_key('scale') else 20
scale = rs.GetReal("scale of the arrow curve", s, 5, 100)
if not scale:
return
sc.sticky['scale']=scale
rs.EnableRedraw(False)
for curve in curves:
lines=[]
if rs.CurveLength(curve)>scale:
pts = rs.DivideCurveLength(curve, scale)
for pt in pts:
t=rs.CurveClosestPoint(curve, pt)
vec = rs.CurveTangent(curve, t)
line = rs.AddLine(pt-vec*scale/10, pt+vec*scale/10)
rs.RotateObject(line, pt, 45)
lines.append(line)
line_copy = rs.RotateObject(line, pt, 90, copy=True)
lines.append(line_copy)
group = rs.AddGroup()
rs.AddObjectsToGroup(lines, group)
rs.AddObjectsToGroup(curve, group)
rs.SelectObjects(lines)
rs.SelectObjects(curves)
rs.EnableRedraw(True)
fenceCurve()
@Gijs do you think you could pep that py snake up a bit to create a partially hatched line, or at least a double curve with periodic segments that i can hatch it myself?
something like that
i created a topic not long ago about this.
@wim can you add this sample to the wish tracker?
Done!
Thanks all. I haven’t gone into GH as of yet. But will check out those Py scripts.
Thanks again
nice one, thanks for the tease glad to test it once its ready!
Hi! This is very cool! I´ve just tried it, and it seems that I can´t scale the symbols larger than 100 units. Is there a chance to dismiss this restriction?
Cheers,
Petr!
sure thing:
scale = rs.GetReal("scale of the arrow curve", s, 5, 100)
change it there