generative modeling for Rhino
So I'm running into a problem trying to explode hatches.
With the following code:
Rhino.DocObjects.HatchObject hatch = x as Rhino.DocObjects.HatchObject;
if(hatch != null){
crv = hatch.HatchGeometry.Explode();
}
I am able to explode my hatches no problem. However, I would like to set all of the hatch patterns to solid first, so that exploding gives me only the boundary (in the form of a trimmed surface) and not the hatch pattern itself. Doing the following:
Rhino.DocObjects.HatchObject hatch = x as Rhino.DocObjects.HatchObject;
if(hatch != null){
Rhino.Geometry.Hatch hatchGeo = hatch.HatchGeometry;
hatchGeo.PatternIndex = doc.HatchPatterns.Find("Solid", true);
doc.Objects.AddHatch(hatchGeo);
}
Will successfully add the solid hatches to the document. However, swapping out that last line for
crv = hatchGeo.Explode();
gives me only an empty array of GeometryBase. Am I missing something?
Tags:
Permalink Reply by Hannes Löschke on June 8, 2012 at 5:11pm What's your Type for the crv? As far as I can see, solid hatches explode to surfaces in Rhino, not curves.
Permalink Reply by Andrew Heumann on June 8, 2012 at 5:25pm it's object, it's an output parameter. I just called it crv before I realized that, but regardless what I'm getting out of the Explode command in the second case is an empty array of GeometryBase.
Permalink Reply by Andrew Heumann on July 24, 2012 at 2:33pm Bumping this discussion - any ideas folks?
Permalink Reply by Mateusz Zwierzycki on July 24, 2012 at 3:04pm how about that :
http://www.grasshopper3d.com/forum/topics/displaying-solid-hatches-...
???
and then get naked polylines ?
Permalink Reply by Andrew Heumann on July 24, 2012 at 4:38pm Thanks Mateusz - the point though is not to create/display hatches but to actually access the boundaries of hatchobjects already in Rhino. I'm coming to the conclusion that it's simply not possible right now - it looks like hatches are pretty poorly implemented in rhinocommon.
Permalink Reply by Andrew Heumann on July 24, 2012 at 3:21pm Perhaps I might get to the root of the question more directly: what is the easiest way via rhinocommon to get at the boundary of a hatch?

I don't know. It might be missing from RhinoCommon so far.
--
David Rutten
david@mcneel.com
Poprad, Slovakia

I just fixed this and added a function to Hatch called Get3dCurves which lets you specify if you want outer or inner curves. This will probably be available in next week's V5 beta (and the next build of Grasshopper in V4)
Thanks,
-Steve
Permalink Reply by Andrew Heumann on September 5, 2012 at 5:16pm Hooray! you're a hero, I've been relying on some highly unreliable workarounds to deal with this in a project I'm working on at the moment.
© 2013 Created by Scott Davidson.
Powered by