Gareth
unread,Aug 7, 2011, 4:07:09 PM8/7/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Sketch Users
I'm trying to draw solids by sweeping points, but I can't seem to
figure out how to apply a style.
From the documentation, you can sweep a line to make a series of
polygones and you add the style with square brackets (the
[fillcolor=white]) bit
def n_cyl_segs 20 def n_views 5 def I [1,0,0]
def endopts [fillcolor=lightgray]
repeat { n_views, rotate(180/n_views, [I]) then translate([I] * 2.1) }
sweep[endopts]{ n_cyl_segs<>, rotate(360/n_cyl_segs, [0,1,0]) }
line[fillcolor=white](1,-1)(1,1)
I'm I'm not sure where it put the style when starting from a point:
def n_toroid_segs 20
def n_circle_segs 16
def r_minor 1
def r_major 1.5
sweep { n_toroid_segs, rotate(360 / n_toroid_segs, [0,1,0]) }
sweep { n_circle_segs, rotate(360 / n_circle_segs, (r_major,
0,0)) }
(r_major + r_minor, 0)
For example, I tried:
sweep { n_toroid_segs, rotate(360 / n_toroid_segs, [0,1,0]) }
sweep { n_circle_segs, rotate(360 / n_circle_segs, (r_major,
0,0)) }
(r_major + r_minor, 0)[fillcolor=blue]
But that didn't work. How do I do this?