Grasshopper

algorithmic modeling for Rhino

Well friends

A fellow architect got a Projet 860Pro 3d printer (bargain: costs less than the GNP of Nigeria). I've asked him: but your models are 10 times the max size > why you did such a stupid thing? He said that he'll invest on SuperGlue ...

Anyway ... he asked me some help on getting (via code) a "solid" mesh (i.e. closed) out of a vast variety of terrain breps . By terrain breps read: trimmed or not surfaces and/or "polysurface" breps (say terrain + excavations etc etc).

Job done anyway ... but by doing it I've experienced some odd/weird stuff:

1. See C# > with "terrain" as closed brep this method: Mesh[] terrainM = Mesh.CreateFromBrep(terrain, MeshingParameters.Default); should yield a closed mesh or not? (see GH component that is added as a comparison test).

2. See C# > Since 1 yields an array of meshes, this method:  Mesh[] terrainMU = Mesh.CreateBooleanUnion(terrainM); shouldn't create a closed mesh? or it is some tolerance thing?

PS: I did it that way:

best, Peter

Views: 578

Attachments:

Replies to This Discussion

Hi Peter

>>Mesh[] terrainM = Mesh.CreateFromBrep(terrain, MeshingParameters.Default); should yield a closed mesh or not?

Usually yes, but not always. This returns brep faces as meshes. This is a choice of the current mesher, and it allows you to choose how to proceed. For example, there are some MeshingParameter settings for which faces will not join, thus, even after joining, creating open meshes.

Mesh[] terrainMU = Mesh.CreateBooleanUnion(terrainM); shouldn't create a closed mesh?

>> Sorry no. A solid Boolean union is the logic union of space surrounded by closed objects. Because most faces will be open, most of the times that union will not be what you obtain after joining all faces. The Grasshopper Mesh Brep component is programmed so that it will join those faces for you. We could add a Mesh.JoinAll() method to RhinoCommon to join all meshes, and it would be similar to this (except for some error checking):

Mesh CreateByJoiningAll(Mesh[] parts)
{
 Mesh full = new Mesh();
 foreach(Mesh m in parts){
  full.Append(m);
 }
 return full;
}

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Giulio,

Thanks of the info. In fact I did it exactly as you suggest (see  code portion captured above) using mesh.Append(i).

best, Peter

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