Hatch areas

Hello!
What’s the simplest way to get the areas of a list of hatches with holes? Sounds trivial, but it ain’t.
Tried already:

  • The ootb Area component cannot digest hatches (Why actually, because the area command in Rhino can).
  • “Elefront Deconstruct Hatch” casts a “Solution exception” error.
  • As does “Human Hatch Explode”.
    Besides them not working, both would output boundary curves, which are tricky to get the area from when there were holes in the hatch.

Thanks!

Hi
Use this method

And sum the outer boundry-sum of inner boundry

Where is your effort and geometry?

If you’re amenable to using Rhino 8 WIP, then we have a couple of pretty easy ways to do this. I just made some modifications to the code base so it wont be available until next Tuesday when the next WIP is released. There’s a sorta hacky way to do it now, but I’d prefer to show you the easier process when the next WIP build is released next week. Is that ok?

1 Like

Thanks everybody!
Here’s my go at it. It outputs the areas directly, without doing boundaries.

import Rhino

rObj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(ID)
if type(rObj) == Rhino.DocObjects.HatchObject:
    hatchGeom = rObj.Geometry.Explode() # Type: GeometryBase. An array of geometry that formed the appearance of the original elements.
    if hatchGeom:
        for geom in hatchGeom:  # Breps
            if geom.ObjectType == Rhino.DocObjects.ObjectType.Brep:
                area = geom.GetArea()

hatch areas.gh (3.5 KB)
hatch areas.3dm (3.5 MB)

The idea behind is that hatches can be used quite nicely for areas of a building, because they, well, define an area, and also display it. That’s so intuitive that it’s a bit odd why they don’t have a GetArea() method.

Thanks!

Starting with the WIP release today of Rhino 8, you should be able to do something like this now.

Alternatively, you can use the updated Text Fields component to evaluate the area using a formula… like this.

2 Likes