Grasshopper

algorithmic modeling for Rhino

Hello,

I'm trying to add a clipping plane to Grasshopper using a C# script but am unsure how to reference one. Do I create a construction plane within Gh and use that as a clipping plane or is there some other way? Thanks!

Views: 5681

Attachments:

Replies to This Discussion

Thanks! But I'm not sure if this is applicable. Is there no way of

You haven't finished your sentence: is there no way of ... what?

BTW: You can use any Plane(s) you want

Sorry! I meant to ask if there's any way to reference a clipping plane within Gh but you've answered that by noting that any plane will do.

This build uses either an internal demo plane or as many planes you want (defined for the occasion via a facet dome).

Pay attention to the flip boolean option:

Why? because the "visible" slice per plane orients // to plane's Z: meaning that you may have defined a zillion of planes but if they point to the wrong direction (in relation to the visible objects)  ... blah, blah.

Here's no clipping planes + a Rhino object (white) + a GH object (blue box: not visible since is "inside" the white one:

And here's what happened if you activate 16 planes simultaneously:

Rhino file contains some instance definitions: place a zillion around and have fun .

Bad news: In real-life ... well .. effectively managing the planes requires code that deals with items in collections (volatile data management).

This is far and beyond of what someone not familiar with coding could master

Note: GH objects behave differently in comparison to Rhino objects (no "heal", that is: switch off the white and observe the blue)

Attachments:

BTW: This "global" delete policy maybe makes some sense more (replace the Purgexxx Method):

private void ClearClipPlanes(ref int removed){
    RhinoObject[] objsPrev = RhinoDoc.ActiveDoc.Objects.FindByObjectType(ObjectType.ClipPlane);
    if (objsPrev != null){
      removed = objsPrev.Length;
      foreach (RhinoObject obj in objsPrev)RhinoDocument.Objects.Delete(obj, true);
    }
  }

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service