Author Topic: mesh boolean demo  (Read 35811 times)

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
mesh boolean demo
« on: December 28, 2011, 12:02:36 AM »
The most recent meshmixer update has a preliminary implementation of something new for meshmixer: mesh booleans. The booleans are definitely a work-in-progress, but I'm putting it out there to get feedback for the next release.

To use the booleans, you just have to import two objects. When you import the second object you will have the option to Replace or Append. In previous versions, when you Append'ed this would just add to the main mesh. Now it creates multiple objects, and when you have no Tool active, you can change your selection by just clicking on the object you want to work on.

To do a boolean, hold down shift and select both objects. Then under the Edit menu you will have the option to do Boolean Union / Difference / Intersection. Difference is the same as Subtract. When you activate one of these, you will either see the mesh rendered pink and purple, or all red. All red means the operation failed. There are no parameters yet, so all you can do is accept or cancel.

The booleans do not strictly require closed objects. A heuristic is used to detect inside/outside, which will work for non-closed objects except near the holes. For example you can usually subtract a sphere from the default bunny unless it is very large and on the bunny's back.

Right now the booleans leave a sharp edge, but that edge will be lost if you do further booleans in the same area. Also sharp edges on your input object will be lost.

More to come...
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #1 on: December 28, 2011, 12:03:39 AM »
Here is an example just adding and subtracting spheres to the bunny. The second image shows a closeup of the mesh with the sharp transition.
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #2 on: December 28, 2011, 12:04:40 AM »
Here are some 'stress-test' examples, doing weird things to a sphere.
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #3 on: December 28, 2011, 12:07:53 AM »
And finally a "more practical" example. In this case I had to close off the bottom of the head. Part of the neck sticks out in a weird way, but the smoothing brushes make short work of that. Easy!
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

HolyEnigma74

  • Global Moderator
  • Full Member
  • *****
  • Posts: 246
    • View Profile
Re: mesh boolean demo
« Reply #4 on: December 29, 2011, 04:49:10 AM »
This is really nice..

I imported from Blender a heavily subdivided cube
(then in edit mode select all "a" then convert quads to tris, (Ctrl+t) or click Mesh/Faces/Quads to Tris
then export the obj.. I exported a Cube and a Cylinder..
for the cylinder i made it 120 segments on the diameter and
i made a whole bunch a loop cuts along its length edit mode (Ctrl+R)
I also put loop cuts on the end select all the edges of the ends then subdivide
hint: use the slider on the bottom left to to crank it up a bunch , so you dont have to keep subdividing over and over
And again before you export convert quads to tris.



The one of the left was done with cylinders, the one on the right was done with meshmixer sphere.
« Last Edit: December 29, 2011, 04:56:04 AM by HolyEnigma74 »

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: mesh boolean demo
« Reply #5 on: December 31, 2011, 05:33:49 AM »
Hi Ryan,

great and useful feature! Thank you for this easter egg!

Besides small distortions at very sharp edges it works perfectly and pretty fast here on my MAC (thanks for updating the MAC version and that fantastic rendering speed too).

I wonder if it would be a big deal to add an additional option that gives Intersection AND Difference as two meshes at the same time.
(The same as you would get, if you do one operation (e.g. Difference) first, save the result, undo the operation, do the other operation (Intersection) and append the mesh saved in the first step. See attachment, were I moved the intersection result a bit)

This would be great to split a mesh into different fitting objects.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #6 on: January 02, 2012, 01:16:00 PM »
Are you basically saying you want to be able to 'cut' surface A using surface B? IE keep both pieces of surface A, and entirely get rid of B?
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: mesh boolean demo
« Reply #7 on: January 02, 2012, 02:58:31 PM »
Yes, surface B would be used only as a "cutting-surface".

Preparing a complex mesh (as a human body) for CNC machining or 3D printing ( to avoid support structures), you often have to cut off arms, legs aso... A flat cut is not ideal to join the parts, later in reality, to their exact position.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #8 on: January 02, 2012, 10:33:35 PM »
OK that is interesting. I think I can do that relatively easily...technically I already have the necessary pieces. Maybe soon =)
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: mesh boolean demo
« Reply #9 on: January 04, 2012, 04:25:12 AM »
Sounds good. Looking forward to it.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
Re: mesh boolean demo
« Reply #10 on: January 08, 2012, 04:36:04 PM »
Today I tried a 3sided BoolBox (made of thin "solid" walls that do not intersect - simple planes failed more often)

painted a selection on one of the walls and extruded the selection. Did such a selection/extrusion on the second and the third wall and "booled" the intersection.

Nice way to get hard edged objects.

Would be nice if one could switch of visibility of objects or make them somehow transparent to paint the selections.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #11 on: January 09, 2012, 10:22:00 AM »
That is clever...I was thinking about adding a tool specifically for this, awesome that it can be done from "first principles" =)

I am also finding visibility very frustrating these days, so I will try to do something about it.

created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

Philo

  • Global Moderator
  • Full Member
  • *****
  • Posts: 183
    • View Profile
    • Philohome website
Re: mesh boolean demo
« Reply #12 on: January 09, 2012, 12:47:39 PM »
I just played a bit with booleans and Inspector, awesome!
To use the booleans, you just have to import two objects. When you import the second object you will have the option to Replace or Append. In previous versions, when you Append'ed this would just add to the main mesh. Now it creates multiple objects, and when you have no Tool active, you can change your selection by just clicking on the object you want to work on.
Don't you think it would be convenient to activate the latest appended object, and perhaps even select it all? The 1st thing you generally do after importation is generally to place the new object.
Philo

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: mesh boolean demo
« Reply #13 on: January 09, 2012, 01:10:25 PM »
Yea that probably makes sense =)
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

HolyEnigma74

  • Global Moderator
  • Full Member
  • *****
  • Posts: 246
    • View Profile
Re: mesh boolean demo
« Reply #14 on: January 09, 2012, 07:47:19 PM »
im gonna beat a dead horse and talk about the need for an axis system, front back, left, right, top, bottom
(shortcut keys) numpad would be ideal like blender/Silo(blenders numpad config is better IMHO)

also a real manipulator translator tool widget that moves in all directions.
look t 3d-coat if you need ideas for universal type manipulators. or make one..
(the translate tool needs a widget that can move in x,y,z space)