Morphing Geometry onto a surface in a vector WITHOUT any side distortion

Hello there.

A colleague of mine did a bold claim the other day. He claimed this is something you can do in Catia but not in Grasshopper.
So…challenge accepted!

He morphed Geometry onto a double curved surface with a given vector, without any side distortion or deformation occurring except in the given vector. So, for example if you were to morph something in the up vector (z), the original and the morphed geometry would look the same in top view.

Any ideas anyone?

Ps:
I have tried 2 different approaches so far. One with the special-deform-component and one using Panelling Tools. Both things didn’t fully work. Spacial-deform gets me weird punctual distortions I can’t control and with panelling tools there is still side distortions occurring. Not very great :frowning:
geo vector morphing_02.gh (75.2 KB)


Hi @Tabak

I wrote a SpaceMorph for you. It will transform geometry following the rule that, I think, applies to the case you specified. Please note that, if the geometry does not fully intersect with the target, it will not work, so the result will be lost.

  class InvariantDirectionalMorpher : SpaceMorph
  {
    RhinoList<Brep> m_target;
    Point3d m_lowestPoint;
    Vector3d m_dir;
    double m_tol;
    Line m_line;


    public InvariantDirectionalMorpher(Brep origin, List<Brep> target, Vector3d dir, double tol)
    {
      Plane p = new Plane(origin.GetBoundingBox(true).Min, dir);
      Box worldBox;
      origin.GetBoundingBox(p, out worldBox);
      m_lowestPoint = worldBox.PointAt(0, 0, 1);

      m_target = new RhinoList<Brep>(target);
      m_dir = dir;
      if (!m_dir.Unitize())
      {
        m_dir = Vector3d.ZAxis;
      }
      m_line = new Rhino.Geometry.Line(m_lowestPoint, m_lowestPoint + m_dir);
      m_tol = tol;
    }

    [System.ThreadStaticAttribute]
    static Point3d[] g_arr;

    public override Point3d MorphPoint(Point3d input)
    {
      if (g_arr == null) g_arr = new Point3d[1];
      g_arr[0] = input;
      Point3d[] res = Rhino.Geometry.Intersect.Intersection.ProjectPointsToBreps(m_target, g_arr, m_dir, m_tol);

      if (res == null || res.Length == 0)
        throw new ArgumentException("This object does not interesect entirely");

      Point3d variable = res[0];

      return m_line.ClosestPoint(input, false) - m_lowestPoint + variable;
    }
  }

splop-project.3dm (274.9 KB)
splop-project.gh (6.2 KB)

I hope this helps getting started.

Giulio


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

4 Likes

Giulio.

It works very well.
You are amazing. I have the impression McNeel has got a lot of great people employed. Thanks for the code.
Merry Christmas to you guys and a Happy New Year to all of you!

Arwed

2 Likes

You are welcome, and thanks for your kind words.
I hope you have a merry time, too.

Could you share what you tried with PanelingTools? I think the attached gets you what you need using PT. I did the example in PT-Rhino (see Notes for the steps in the attached Rhino file), and you can do the same in PT-GH.
DirectionalMorph.3dm (661.4 KB)

2 Likes

Dear Raja.

Unfortunately I can not share the real pattern with you but I can
create an example pattern that illustrates the problem better.

Essentially it is about morphing an existing, flat pattern geometry
entirely towards a surface in a specific vector in one go (as one
cell so to speak) instead of panelling something with many cells
directly onto a surface. The distortion in that case would be smaller
the more cells you use but still existing though. Unless I didn’t
use the right technique to do it with Panelling tools…:slight_smile:

I have tried to overcome the problem by using the morp-3d component
in GH with only one cell and using the entire pattern geometry as the
input for the pattern object. Smooth morphing on. Obviously, there is
distortions occurring.

The pyramid trunk you and I played with isn’t a good example since
that is simply easy to panellize with Panelling tools directly at the
curved surface.
The real pattern would use something like these two hexagons as a pattern object.

The real workflow I imagine would be:

  1. create a flat pattern. (these two hexagons many times repeated in
    an array in x and y)

  2. extrude the flat pattern to create solids

  3. apply draft angles to some of these solids (required for the
    tooling of plastic parts)

  4. morph the whole thing to a curved surface with a given vector.
    (for example in z-direction) No side distortions allowed, because you
    would loose the draftangles on those solids.

I hope this made the problem a little more clear. Thanks for your
help and your amazing work. I really appreciate it.

Cheers, Arwed
Ps: Also, merry Christmas and a happy new Year to you and your family.

In the example I shared, I forced the extrusion direction by “copying” the paneling grid in the desired direction (Z in this case). The morphing adheres to that direction and should give you the result you are after.

An alternative workflow can morph the 2D pattern, then extrude as in the following:
1- Create flat pattern that covers the footprint of the target surface.
2- Project to the surface (or panel the 2D pattern to the surface if works better)
3- Extrude the 2D curves (now on the 3D surface) in the “Direction” you need to create solids.

This is fantastic. Exactly with I needed.

Hi Rajaa:

Your post from back in 2017 is very relevant to what I’m doing now. However, I don’t see a .gh or .rhp file to get the command you describe using in the .3dm file you posted:

3- Use ptPanel3DCustom to morph the object

Are those files still available? Thanks for your help.