Nautilus plugin

Laurent, you’re amazing, the details are stunning.

You do amazing filters that photographers, publishers and offset printers would love to get their hands on! :wink:

I saw this science news article about patterns in diffusion and this might give some ideas!

Related wiki
Diffusiophoresis and diffusioosmosis - Wikipedia.

I just tested that because I saw this instagram and this tool. I didn’t test it but wanted to test my own tool.

Wow, that is beyond adaptive diffusion to pattern morphing! Not exactly GH material right? But why not! :wink:

https://lostminds.com/products/

Check out Patternodes.

Reminds me of the old MacOS screensaver FlowFazer and the Kai Powertools plugin on Photoshop!

Bring it on!

1 Like

Cool to see other nice Nodes tool. I’ll stay with Grasshopper, I don’t really need other thing for now.
Reaction Diffusion Extended allows to put variable of reaction diffusion coefficient on all points of the mesh. Like it was done by @Bathsheba here

This allows this kind of thing.
Linear variation depending on the brightness for
dA diffusion A
dB diffusion B
F (feed)
K (kill)



Adding some directionality on the dark colors

1 Like

Hi @laurent_delrieu

I’m truly fascinated by the Nautilus plugin and always find myself learning something new from your posts. Thank you for your exceptional work!

I’ve noticed that Nautilus includes several image-related components that require an image file path to run.

I’ve also been working on a plugin called JAVID, which handles bitmaps. There’s also the Bitmap+ plugin (@DavidMans). I think it would be great if Nautilus could take bitmap objects directly, so these plugins could work better with each other.

As a suggestion, perhaps you could include a simple component (like this) that accepts a file path and opens the bitmap .This would help Nautilus work on its own and also with other plugins.

4 Likes

@Mahdiyar thanks for the interests and suggestions. I have now changed a bit the way inputs and outputs work. For the input of 3 component they accept as image

  1. A path
  2. An image
  3. A mesh (if mesh is similar in topology to a Mesh Plane

So the fun thing for example is take a Twisted Torus and apply Reaction Diffusion Extended Reaction Belousov or Noise on Mesh then send the colored mesh to a tool that transform a FilePath, an Image or a Mesh to an Image, a Mesh, The rectangle cell and Width and Height Object to Image then apply color on face then we have a tileable Image.
One problem of mesh colored is that color is on vertex. It is better to represent an image with color on face, a face is a pixel. But the color on vertex is more simple and useful for other stuffs.


  public static bool ObjectToImage(IGH_Goo goo, out Image img, out string errorMessage)
        {
            bool output = false;
            img = null;
            errorMessage = "Nothing";
      
            if (goo.CastTo<System.Drawing.Image>(out img))
            {           
                output = true;
            }
            else
            {
                Mesh mesh = null;
                if (goo.CastTo<Mesh>(out mesh))
                {
                    if (mesh.VertexColors.Count == mesh.Vertices.Count)
                    {
                                      int min = Math.Min(Math.Min(mesh.Faces[0].A, mesh.Faces[0].B), Math.Min(mesh.Faces[0].C, mesh.Faces[0].D));
                        int width = Math.Max(Math.Max(mesh.Faces[0].A, mesh.Faces[0].B), Math.Max(mesh.Faces[0].C, mesh.Faces[0].D)) - 1;

                        if ((mesh.Vertices.Count % width == 0) && min ==0)
                        {                            
                            int height = mesh.Vertices.Count / width;

                            Bitmap bitmap = new System.Drawing.Bitmap(width, height);
                            for (int i = 0; i < width; i++)
                            {
                                for (int j = 0; j < height; j++)
                                {
                                    bitmap.SetPixel(i, j, mesh.VertexColors[j * width + i]);
                                }
                            }
                            img = bitmap;
                            output = true;
                        }
                        else
                        {
                            errorMessage = "Mesh not representing an image";
                        }
                    }
                    else
                    {
                        errorMessage = "No Color in the mesh vertices";
                    }
                }
                else
                {
                    string path;
                    if (goo.CastTo<string>(out path))
                    {
                        //https://github.com/dalefugier/Vectorize/blob/main/VectorizeGh/VectorizeGhComponent.cs
                        //string path = null;

                        // Validate path string
                        if (!string.IsNullOrEmpty(path)) path = path.Trim();

                        if (string.IsNullOrEmpty(path))
                        {
                            errorMessage = "Not a good image path";
                            return false;
                        }

                        // Validate path
                        if (!File.Exists(path))
                        {
                            errorMessage = "The specified file cannot be found.";
                            //  AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "The specified file cannot be found.");
                            return false;
                        }


                        try
                        {
                            // Creates a bitmap from the specified file.
                            img = System.Drawing.Image.FromFile(path) as System.Drawing.Bitmap;
                            if (null == img)
                            {
                                errorMessage = "The specified file cannot be identifed as a supported type.";
                                return false;
                            }

                            // Verify bitmap size
                            if (0 == img.Width || 0 == img.Height)
                            {
                                errorMessage = "Error reading the specified file.";
                                return false;
                            }
                            output = true;
                        }
                        catch (System.Exception ex)
                        {
                            errorMessage = ex.Message;
                            return false;
                        }

                    }
                }
            }
            return output;
        }
1 Like

Thank you for taking the time to consider my request. I really like how you approach this.

It is a bit tricky to work with bitmaps. Grasshopper SDK offers a GH_MemoryBitmap class that can help a lot. I’ve used this class to create meshes from bitmaps quickly.

This is how you can create a bitmap from a mesh in Javid:


Nautilus.gh (14.7 KB)

1 Like

And the new way !


There is just an inversion in Width and Height that I will not correct as it works like that from Image preview from Grasshopper

By the way Thanks for the tip, for sure Grasshopper SDK has lot and lot useful tools, and many converters. I looked a bit to what you proposed but at the end it seemed more simple to output an Image, most of the tools accept it like that. Compatibility is better.
Your outputs doesn’t work with Quick Preview from Shape Diver but works with the other previewer (Wizard, Bitmap).

Just a little remark on “Rectangular” Mesh
Image pixels are beginning on Top Left and going to the Right and going down


Mesh Plane are beginning on Bottom Left and going to the Right and going up

1 Like

Hello @Mahdiyar
version 0.9.4 is out on Package Manager for the moment.
I changed some of the inputs that were Path by inputs allowing Paths, Image, or rectangular Mesh (color on vertex or on faces).


Object to Image


Open a Bitmap, from Javid here

“Read” a colored mesh

Image Thinner now accepts Mesh and Bitmap

I added Region To Roof Transform a planar region to a roof.


Following some discussion from there

and the initial discussion

Region To Mesh


Following this discussion

4 Likes

Version 0.9.6.1 is out
Polygonal Spiral


Polyline Spiral


Rubber Band

See there

TSP on Mesh On closed non intersecting curve passing through most of the mesh vertices by using the edges



See there

Change in the logic of orientation of the planks Plank from Region, now by default planks follows the flows (gravity)

Region to RoofNow the roof have merged coplanar faces

Some options added on Pack Objects on Grid
Rectangle around object(s), number of rows and columns

4 Likes

Version 0.9.7 brings


See there for Dubin’s Path

See there for TSP, surely not the best word but the real could be “closed non intersecting path using edges and going through most of the points”

5 Likes

Happy New year everyone. Nautilus v1.0.0 is out.




Some new components
Curve to Lines and Arcs
Curve Region to Roof
See there

A little component to output fonts avalaible
Font Filter Component
image

By default I try to output just single line fonts. If you use other Single line font send me the names

9 Likes

Happy New Year to you @laurent_delrieu
Glad to see V 1.0
So many idea comes to mind with new features you added.


Happy New 2024 to great community.

1 Like

Hey Laurent,
thanks for your tools. The “Curve To Lines and Arcs” converts some “S”-letters from single line fonts to closed shapes. Can you have a look? File attached.
nautilus_curve_to_lines_and_arcs_problem.gh (13.2 KB)

Thanks for the report, as a workaround you can set Heal to false, or RhMethod to true

I looked into the set of tools inside Nautilus and I’m very intrigued in getting myself familiarized with it! It is going to be one of the moslty used plugins in the GH community.

1 Like

Hello, I updated Nautilus. It was the healing that bring problems. The healing tool just try to align better the arcs.

1 Like

Following a request and this dicussion, version 1.1.2 brings :

I began to make a little tool that detects the holes in a Brep. As it is not clear for me how to use it. If you have some request or part that could be improved. At the moment it outputs 2 planes, a top one and lower one. Plane Z is pointing outside. I also output radius and if holes is both sides.
The tool trys to merge trimmed cylinders that make a whole cylinder.


In red this one is not detected. I will improve that. But the question is “What is a hole”
The green one with 2 radiuses is just like a single one. I will improve that.
Previous tool doesn’t find that

FindCylindersAndEdges (2).gh (148.5 KB)

Version 1.2 brings many new things
Examples are provided on Food4Rhino
An evaluation licence is also part of the zip and is valid until the 12th of February

Tools to make these dual things on mesh
Mesh Split on Edges (open and closed mesh)
Mesh Subdivide with Materials,





Brep Hole detection
With no filtering


With filtering

3 vector fields
Vector Field from Noise (Curl Noise)
Stepped Vector Field from Noise (Curl Noise)
Curl Noise in 2D (XY plane),


Mesh Field Line, so the curves will stay on the mesh

Cluster Mesh Extended

Field Vector On Mesh, Mesh Values On Vertex To Edge,

And others things to make stuff like this


12 Likes

I added 1.4 version on Package Manager then on Food4Rhino.
I added some tools for Gradient Flow

2 Likes