C# Delaunay Mesh syntax (with optional base plane)

Well friends...

What is the syntax for taking into account an optional base plane? (as the GH component does/has).

thanks in advance, best, Peter

  • up

    David Rutten

    That's a bit tricky, as the Plane type is a struct and thus never null. You could check to see if the plane is invalid (if all vectors are zeroed out, the plane has probably been made with the framework constructor), then assume the plane is optional.

    In Grasshopper components this is not a problem, because all data is wrapped inside IGH_Goo interfaces, and an interface can always be null.

    Another approach would be to not use the Plane type hint, instead stick to object, and then test the value for null:

    Plane actualPlane;

    if (plane == null)

      actualPlane = WhateverTheDefaultIs;

    else

      actualPlane = (Plane)plane;

    3
    • up

      Seb Gey

      Dear Peter and all GH folks,

      I have been researching a way to achieve something similar, which would probably seem simple to you GH gurus! 

      I have a relatively complex (in terms of curvature) polysurface which I would like to map a delaunay pattern onto. The intent is to populate the surface/facade continuously with delaunay from randomly assigned points, which will later be rearranged with Galapagos to maximise some environmental conditions. 

      I have got the Galapagos bit right but I cannot figure out how to evaluate the surface in order to provide me with the planes to map the pattern. The definition works on a planar surface. 

      I have tried using the scripts and C# that you guys kindly provided (I have no notions of scripting) but it does not seem to work, as I get a common feedback from both 3 options provided in the script, which is "invalid mesh at nodes x".

      Could you guys please help me out? How can I populate the facade to the edges while preserving the density and randomness of points (because these will be used as the Galapagos genome)?

      Thank you for your great help!

      2