Grasshopper

algorithmic modeling for Rhino

Hey everyone,

I am trying to model a map that is been routed into wood planks. I've tried extruding and capping thickened streets and differencing them from the base material, but that does not work (it fails). Now I am trying to difference it from a region, from where I will extrude the negative to the thickness of the route (this only sometimes works). I've tried srfsplit to get the negative regions, but that does not always work. Is there a more reliable way to essentially perforate a surface with closed curves (I want the negatives, which are essentially the city blocks). Maybe there is an add-on that does this?

The sample script includes two planks of wood with their respective thickened streets. In this current state the ends are not semicircles, but faceted polylines that are scaled down so there is not so much border to border alignment at the intersections. The streets are also extended past the border of the wood planks so there is a clean cut. You'll need to zoom out a little, the geometry is at about (25,100,0).

***Update***

It seems that the best way to split the geometry is to actually bake the thickened streets and then split the wood plank surface with them. I've found that doing _split and _trim works really fast in rhino, but then their equivalent in grasshopper and GhPython are much slower. Is there a way to do _split in GhPython? The only way I have been shown is to do rhino.brepface.split(mybrepface,mycurves,.001), but this is extremely slow.

Start with vectors:

Thicken vector:

Region boolean difference failure:

Views: 2394

Attachments:

Replies to This Discussion

Hi,

I looked at this and believe a basic problem is a flawed street map in 'original road crv'.  It contains a bunch of line segments that overlap poorly, so no matter what you do to them to get wider street surfaces, it comes out badly.

That said, I managed to get decent road surfaces from 'road region':

Attachments:

Thanks for your input. The original street was generated via Elk from OpenStreetMap data. I know that the curves probably do not intersect cleanly, but how does that affect the geometry downstream? It is my suspicion that boolean operations fail when too many edges line up, which is why I scaled the semicircle ends so they don't reach a across the thickness of adjacent streets. But overlap in this situation is good right? So there is a clean region/boolean difference?

And the sample I posted are two of the lighter planks. Some wood planks have hundreds of streets on them which make them really prone to fail.

A key step in getting the road surfaces was partitioning that list so each curve became a separate surface instead of mixing all the boundaries together.  If you can get a good extrusion of the streets, the 'SDiff (Solid Difference)' step should take it out of 3D planks just fine.

The Ramsden component for Elk roads sounds great!

I see what you mean by bad curves. When the curves were offset to create thickness, some of them formed self intersections.

Is there some way to simplify curves after offset. I feel like they should have a more intelligent offset component.

Hi Lawrence, 

You could try with James Ramsden component for Elk roads:

http://james-ramsden.com/convert-a-network-of-roads-into-2d-curve-p...

Lg 

Igor

Many thanks for sharing my link Igor :)

Lawrence, this method should actually work for any polylines (not just roads). We recently had a job in the office where we needed a continuous area which represented a city's road pavement area - essentially the same but opposite of what you seem to be after. This method worked 99% well, with only a minimal amount of manual tidying-up at the end.

Out of curiosity, if you are after city blocks, depending on what you are ultimately after, mightn't it make sense to extract building outlines directly with Elk/OpenStreetMap? See this older post for an example.

Thanks for sharing your script. I was able to get the blocks for some regions of the map with your script, but my map is larger so in some places your "road" script would leave out segments in the road. Ultimately, using your method or mine, "region union" fails because of the way the thickened streets line up. It looks like booleans don't like edges that are too perfectly aligned. 

In the end I was able to take it into illustrator which has a good tool for trimming with regions. And it took less than 10 seconds to accomplish this task. My map has almost 5000 curves.

Maybe this is something the developers can look into. Illustrator has really good region boolean tools, and work effortlessly. Just think about how slow srfsplit is just to divide up a surface with a set of curves (and for some reason _split in rhino work much faster, but does the same thing)

Appreciate the reference. much useful. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service