Grasshopper

algorithmic modeling for Rhino

Dynamic remeshing - now with feature preservation, curvature adaptivity, and minimal surfaces

This will be incorporated into future releases of Kangaroo, but because it is so much fun to play with (not to mention useful!), I was excited to share this as a standalone component right now.

This is a tool for remeshing, as I first wrote about and demonstrated here.

However, since those first videos over a year ago, this has been improved upon and developed a lot. 

One of the most significant changes under the hood is that it now uses the custom half-edge mesh class Plankton developed as an open-source collaboration by myself and Will Pearson (to whom I owe great thanks for all his fantastic work on this). Big thanks also to Giulio Piacentino for sharing his great work on Turtle, and to Dave Stasiuk, Mathias Gmachl, Harri Lewis, Jonathan Rabagliati and Richard Maddock for helpful mesh discussions.

High quality triangular meshes have many applications, including physical simulation and analysis.

Since I shared some examples of remeshing scripts here, I have also added a few more features in response to discussions and requests:

Feature preservation

This allows the user to set curves and points to be preserved during the remeshing. These can be boundaries or internal curves, and can be useful for keeping sharp creases, or separate regions. (One of the major applications of this tool is creating high quality meshes for input into analysis programs.)

These features can now even be moved while the remeshing is running, and the mesh will stay attached.

Curvature Adaptivity

When a mesh contains features with tighter curvature, smaller edge lengths are needed to faithfully represent the geometry. However, applying these reduced mesh lengths across the whole surface, even in flat areas where they are not needed can be impractical, and slow everything down. A solution is to refine the mesh according to local curvature.

'Fertility' model from AIM shape repository, remeshed with curvature adaptivity. Here the edge flipping option is also set to valence based, which causes the mesh to become anisotropic in the direction of curvature.

Minimal surfaces

Relaxation based purely on 1d elements will not give accurate minimal surfaces, we need to use proper 2d elements.

However, when relaxing meshes to produce minimal surfaces, generating a high quality initial mesh can be problematic and tedious. Uneven meshing can cause the relaxation to fail or give incorrect results, especially when the relaxed geometry changes significantly from the input, causing the triangle quality to degrade even further.
By continuously updating the connectivity of the mesh to maintain even sized and nearly equilateral triangles, even very large changes to the boundaries become possible, and the surface still minimizes mean curvature.

This allows exploration of sculptural forms in a more dynamic and flexible way than I think has ever been possible before (seriously - try it out, I think you'll enjoy it).

Surfaces may 'pop' if the boundaries are moved suddenly or too far apart - as sometimes no minimal surface solution exists with the given boundary conditions.

Any plugin claiming to produce minimal surfaces which lets you move the end rings of a catenoid arbitrarily far apart and still gives a tubular solution is lying! The only proper behaviour in this case is to collapse into 2 flat disks. (As it is currently, the disks will remain connected by an infinitely thin strand, as I have not yet implemented anything to allow genus change, but maybe in the future.)

Here is the component and a basic example file. Feel free to ask any questions about its use, report bugs, or request changes or additions. This is still a work in progress.

MeshMachine.gha

Plankton.gha

Plankton.dll

Remesh_new_examples.gh

To install, unzip and place the dll and 2 gha files in your Grasshopper libraries folder (replacing any previous versions of these you may have installed - these are more recent than other releases). Make sure they are all unblocked, and restart Rhino.

Views: 56440

Comment

You need to be a member of Grasshopper to add comments!

Comment by Ioanna Symeonidou on April 30, 2014 at 6:07pm

Hello Daniel !

Great tool, thanks for sharing, it works perfect !!! I am playing with it the whole day.

Just one question. Is the mesh machine acting as a particle-spring system ? Could we set the restlength and stiffness here? Or are those parameters somehow included in the "pull" ?

It seems that if we set pull to 0 we obtain something like a minimal surface, similar to what we get with Kangaroo physics if set spring length is 0. Is that right ?

FixC or FixV looks like setting the anchorpoints. Are these two equivalent methods for dynamic relaxation? 

Does it make sense to use a combination of the two, remeshing first and then feeding the new mesh into Kangaroo physics?

It works great and i experimented with minimal surfaces, using the fourth one of your examples and moving the two circles afterwards.But the moment I tried to change the length on the slider it throws an exception

Problem is, that even if I go one step back, it will not work and I would need to extract new boundaries from the initial surface, if I use the existing ones, as they are already moved, they are not attached on the surface, and it will create a mesh without holes.

I tried the same example several times. Sometimes it works (as in the first pic) sometimes not, and it starts to peel off from the corners towards the center before it throws an exception. Any suggestions?

I just want to understand how to avoid this problem from happening, cause it does NOT happen all the times.

If it does happen, some seconds before it throws an exception it starts to peel like this, from the corners inwards:

As I did the same experiment many times I noticed that the failure does not relate to the value in length... but to something else that I cannot figure out. It only occurs when I change the value in the slider, but NOT always

Thanks in advance,

ioanna

Comment by Nick Tyrer on April 28, 2014 at 3:10am

Thanks for explanation Daniel, that makes sense, i was playing around creating a mesh that rapidly changed from huge faces to tiny faces, and inevitably i was producing faces with very high valence. I was trying both options with similar results, but obviously thats just an issue with high contrast face size.

Comment by shalom buberman on April 28, 2014 at 1:12am

Hi Daniel,

I installed the files, replacing the old ones and got a loading errors message:

Object: MeshMachineComponent (level 1)
{
Exception has been thrown by the target of an invocation.
TargetInvocationException
}

Object: MeshMachineComponent (level 2)
{
Could not load file or assembly 'Plankton, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
FileNotFoundException
}

how can I fix it?

Thanx!

Comment by Daniel Piker on April 26, 2014 at 12:22pm

Thanks everyone for the encouragement!

Panhao - yes, this Plankton dll can replace the old one from Kangaroo 0096

Vicente - I think making a non-timer version should also automatically solve the issue of allowing different meshes on different data branches, because all iterations on one mesh item would be happening within a single solveinstance.

It is a bit more complex with the non-timer Kangaroo, because I want to also allow people to use forces which change their parameters from one iteration to the next (such as hinges with a rest angle which varies over the course of the simulation).

Nick - in both cases the flipping is based on the 4 vertices of a pair of triangles:

The angle based option decides whether to flip each internal edge depending on the sum of the marked angles (choosing the one which gives the smaller value).

The valence based option chooses whether to flip the edge depending on the total valence error over these 4 vertices.

The valence error is how much each valence differs from the ideal (6 for internal vertices, and 4 for boundary vertices). So in the picture above the left version has valences of 5,7,6,7 giving a total error of 1+1+0+1=3, while the right version is better with 6,6,7,6 giving 0+0+1+0=1

Comment by Nick Tyrer on April 25, 2014 at 11:56am

Daniel, would you be able to tell me a little more about the 'flip' input. valence or angle based. 

Does the valence option prioritise keeping the valence variation to a minimum?

Anything like described here: http://www.grasshopper3d.com/profiles/blogs/mesh-optimization

Comment by Duncan W on April 23, 2014 at 1:14pm

Daniel, I'm only beginning to venture into the possibilities Kangaroo allows, yet I already feel an urge to join the choir of people who express their gratitude. Grasshopper itself is already super exciting. The videos you post are even more shocking. I'll wait for the future stable release as I need to understand the Kangaroo basics first, but I already know for which projects of mine I will want to use these new features and I totally can't wait.

Thank you!

Comment by Robert Vier on April 23, 2014 at 12:19pm

GREAT tool!

love the zombie physics as well

Comment by Vicente Soler on April 23, 2014 at 10:07am

More than making the components work without a timer (you can already do this Kangaroo by increasing the subiterations and inputting a true and a false value to the start input. You can also do it with the remesher using a list of true, false, false, false... values but has the added lag of solveinstance on every iteration) it would be great if you could have parallel simulations running in the same component.

In the case of the remesher, if you connect a list of objects it will have a different simulation for each object (right now you can join a list of meshes into a single one but its not the same, it might screw up the object order after disjoining them and it's slower and so on).

In the case of Kangaroo, one simulation per branch of forces and anchor points. The tricky part would be the geometry input. Maybe if you have two simulations, all branches of geometry starting with {0;*} will be mapped to the first simulation, all starting with {1;*} mapped to the second and so on.

Comment by Nick Tyrer on April 23, 2014 at 9:41am

I agree mesh colour would be a great control. So much flexibility. 

Comment by nardo chai on April 23, 2014 at 9:13am

Fantastic!Thank you. Thank you for letting me know so many things.

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