Grasshopper

algorithmic modeling for Rhino

I have a 3D printer that builds layer-by-layer. If a model has overhangs, the printer builds a support structure below to hold it up. I want to find the orientation that minimizes the amount of support material required.

I've used Grasshopper to find the projection of the mesh onto the floor plane, and used Galapagos to minimize the area of this shadow. It's my first time using Galapagos, and I'm amazed at its power.

But I don't want to minimize the shadow of the mesh, I want to minimize the volume contained between the shadow and the lower surface of the mesh.

Any elegant ways to do this?

Views: 3067

Replies to This Discussion

Interesting problem. I can't think of a good solution to this using Solid Booleans. However the following may work as an approximation:

  1. Create a Grid (regular or random, doesn't really matter) of points definitely above your shape.
  2. Create vertical lines from the points in this grid to the projection of those points on the groundplane.
  3. Intersect the shape with the vertical line.
  4. If there are no intersections, disregard the line.
  5. If there are intersections, ignore the topmost segment, then ignore every other segment, starting at the first.
  6. The sum of the length of all remaining segments is an approximation of the volume you're looking for:

A is the point in the grid, guaranteed to be above the shape.

B is the point directly underneath A on the ground plane.

X0..X1..Xn are the intersection points. You're looking to add together the lengths of segments X1-X2, X3-X4, X5-X6, ...., Xn-B

--

David Rutten

david@mcneel.com

Tirol, Austria

See attached. It's not fully automatic, you may have to adjust the size and count of the grid points to make it work for you. It also only supports a single mesh shape at the moment which must be closed and fully manifold. I attached the file.

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

Incidentally, the more rays you shoot the more accurate the approximation. You should keep the points the same between Galapagos iterations so make sure your points are high enough and spread wide enough to encompass all possible shape rotations.

--

David Rutten

david@mcneel.com

Tirol, Austria

Very nice! I got about halfway there last night, but hit a wall when I realized I would finally need to learn how to work with trees...

I'll be careful to normalize the results by the number of rays cast and the area of the floor plane. Choosing the right number of rays will take some finesse. Too much noise will make optimization tricky.

I thought of populating my rays from the shadow of the object, rather than a rectangle. This would ensure that there are no "wasted" rays that don't intersect the object. Unfortunately,  "populate geometry" doesn't do so uniformly, and some parts of the shadow get far more points than others.

Attachments:

It works!

I was able to successfully generate uniformly distributed points in the shadow only (the trick was to use outline, not project).

Most of the second half was copied from David's code - I need to study it carefully to understand grafting, simplifying, etc. Any recommended data structure/tree tutorials?

Optimization works very well, even with as few as 200 sample points. This is the result of about 5 minutes of evolution.

Attachments:

Are you trying to work this out because support material on reprap style 3d printers is usually not great and you want to minimise how much of the model ends up with the rough and/or distortion effects from the support?

Grasshopper might actually be a good tool for generating support structures but I don't know how this could be then included in the slicing software that creates the g-code for the printer.

I experimented a bit with the hexagonal support vs the square grid support and got mixed results... I found best results with the hexagonal support but sometimes it looked like it would work better if I could dynamically change the size, orientation and position of the hexagons to get the best support but minimum effect on the surfaces.

One day, maybe, there will be a grasshopper 3d printer slicer!

Hi All, 

I started to work on a similar task a while back, and was tackling the problem in a similar manner. I started by finding the bounding box of the geometry which would give me a domain to lay my point grid and would also give me a maximum height to check against for my vertical rays. I then generated mesh supports with sliders to adjust for thickness. I ran with the idea of the support material on the Form1 printer, and added a few tweaks to it. The one issues I ran into was the slicing software. Once I imported my model with the support structure into the slicing software, it took forever to slice. Then I started to think about developing a slicing algorithm. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service