I've (along with a colleague) created a fairly rudimentary city building voronoi command, that populates a given region with a random scattering of points, and from those points creates a voronoi which is then in turn trimmed using the region inputted at the start.
At this stage everything works smoothly (picture 1). Using these curves I then want to offset to create a road network, offset once more to create a building depth and then loft to create the final building.
Unfortunately the voronoi curves along the edges are open curves from where they were trimmed, and as a result the offset fails to work correctly (not suprisingly) but I can't seem to find a method to close up the curves using the bounding area to close them? I've tried region difference/union/intersection as well as join curves to no avail.
At this point the only thing I can think of is to avoid the trim, check where the curves intersect and create points and then use those points to create a line and close the outer curves in that way, although that would ruin the curvature of the region.
Had limited success with region intersection. In the end it it did leave me with a series of joined curves (as far as I could tell), BUT it was taking 56,000ms to calculate the intersects, so thats obviously not ideal. May end up baking the basic curves, manually joining them in Rhino and then using grasshopper for the offsets and extrudes/lofts.
"The Voronoi solver has been highly optimised, and at present it can only deal with convex polygons. I'll add another component which allows you to supply a curve, and then I'll use the convex hull of the curve control points as the boundary. Would that work?"
It may do, although trimming by region works just as well, it was more trying to simplfy the steps required to fit a voronoi curve to a region.
The main 'problem' were the cells lying on the region boundaries and being unable to make them intersect/work with the region that trimmed them (with ease) in order to create closed curves, hence the suggestion that the boundary component could use curves and negate the extra commands I'm using now. Unfortunately in 3D modeling/rendering/et al there's never going to be that magic button that does all the hard work for us.
Mattias, thank you very much for that solution. Thanks to some nasty little virus I managed to infect the PC at work with I'm having to reinstall all my software and get back on schedule, so hence the late reply. I'll give your solution a go once I get back up and running, but looking at the pictures it seems to do exactly as I wanted.
Just tested your solution mattias and it's rather wonderful. The only issue I've had is grasshopper's(seemingly?) reluctance to trim/cull reliably with lots of curves at once (as in, some of my curves remain blank rather than having a nice trimmed voronoi in them). I had the same issue with multiple curves so I'm certain its that rather than your solution.
I'm not sure if its purely a question of size, number of curves or what, but has anyone had some experience with solving this?
Daniel Illum-Davis
Jan 7, 2010
Daniel Illum-Davis
"The Voronoi solver has been highly optimised, and at present it can only deal with convex polygons. I'll add another component which allows you to supply a curve, and then I'll use the convex hull of the curve control points as the boundary. Would that work?"
It may do, although trimming by region works just as well, it was more trying to simplfy the steps required to fit a voronoi curve to a region.
The main 'problem' were the cells lying on the region boundaries and being unable to make them intersect/work with the region that trimmed them (with ease) in order to create closed curves, hence the suggestion that the boundary component could use curves and negate the extra commands I'm using now. Unfortunately in 3D modeling/rendering/et al there's never going to be that magic button that does all the hard work for us.
Mattias, thank you very much for that solution. Thanks to some nasty little virus I managed to infect the PC at work with I'm having to reinstall all my software and get back on schedule, so hence the late reply. I'll give your solution a go once I get back up and running, but looking at the pictures it seems to do exactly as I wanted.
Jan 12, 2010
Daniel Illum-Davis
I'm not sure if its purely a question of size, number of curves or what, but has anyone had some experience with solving this?
Jan 12, 2010