Builders/Metalab/AoI CSG Evaluator

From RepRap
Jump to: navigation, search

CSG Evaluator - A useful plugin for AoI for doing multiple boolean operations

Note: This software has been superseded by OpenSCAD - http://www.openscad.org

Objective of CSG Evaluator

AoI is nice but manually booleaning all the objects together is cumbersome. And if you want to change something you have to do it all again :( CSG Evaluator (called like this because internally AoI calls the boolean objects CSGObjects - CSG stands for Constructive Solid Geometry) allows you to create a hierachy of booleaned objects. Later you can change the consituents and with just one click re-evaluate the boolean tree. Away with the long lists of Boolean Objects that spoil your nice AoI file!

Download

  • CSG Evaluator can be installed from the Scripts and Plugins Manager from within Art of Illusion


  • Alternatively, for manual install, copy this jar to the Plugins dir in your Art of Illusion installation dir:

http://reprap.svn.sourceforge.net/viewvc/reprap/trunk/old_files/miscellaneous/AoI/plugins/Plugins/CSGEvaluator.jar


Tutorial

First you have to copy the plugin into the "Plugins" Directory where you installed Art Of Illusion. This is just like installing any other plugin. Then start AoI.

First lets create a cube positioned at the origin with a side length of 10mm. I named it "My Cube".

CSGEvaluatorStep1.JPG

Now lets create a sphere with a radius (in all three dimensions) of 6mm. Also positioned ath the origin. I named this sphere "Inner Sphere".

CSGEvaluatorStep2.JPG

Now lets open the CSG Evaluator Dialog by chooing it from Tools->CSG Evaluator...

CSGEvaluatorStep3.JPG

It should appear in the lower left corner. Notice thats its always on top. It can also be toggled by pressing the c-button.

CSGEvaluatorStep4.JPG

Now select the cube and the sphere we just created (hold the Ctrl button to select multiple objects) and press the "difference" button in the CSG Evaluator dialog. This might take some time to calculate.

CSGEvaluatorStep5.JPG

Now the screen should look like this.

CSGEvaluatorStep6.JPG

What happened? The CSG Evaluator created a new object called "difference" which is the cube with the sphere subtracted. But the original objects are still here. They are children of the "difference" object. You can see this when you click on the small triangle next to the "difference" object. So click on the small triangle to verify it yourself.

CSGEvaluatorStep7.JPG

So the cube and the sphere are children of the "difference" object and they are greyed out because they are hidden.

Although the cube and the sphere are hidden you can still change their parameters. For example lets make the radius of the sphere large. Lets increase it to 6.5mm (in all three dimensions).

CSGEvaluatorStep8.JPG

Huh? Nothing happened? Why? Well the sphere is hidden - so you cant see the changed radius and the difference does not get updated automaticly. To recalculate it you have to select the "difference" node and click at the "evaluate" button in the CSG Evaluator dialog.

CSGEvaluatorStep9.JPG

Ah! Now the difference got re-evaluated and so the resulting object changed.

CSGEvaluatorStep10.JPG

But maybe blindly editing properties of hidden objects is not your thing. Would it not have been much nicer if you could have seen the sphere to choose the right radius? You can do this. Make sure the difference node is selected and click at the "devaluate" button.

CSGEvaluatorStep11.JPG

Now the "difference" node is hidden and its consituents (the cube and the sphere) are visible again.

CSGEvaluatorStep12.JPG

Now you could visually change the cube or the sphere, move them around and so on. But we (or at least I) are already satisfied with the way they are so lets just "evaluate" them again. This might take some time to calculate.

CSGEvaluatorStep13.JPG

The object we created looks nice but it still has sharp edges. Children might get hurt! So lets create another sphere also positioned in the origin with a radius of 8mm (in all three dimensions). Lets call this one "Outer Sphere" and just for visibility lets change the display mode to transperent (Scene->Display Mode->Transparent) at least in one view so we still see whats going on.

CSGEvaluatorStep14.JPG

Now select the "difference" node and the "Outer Sphere" and click at the "intersection" button in the CSG Evaluator dialog. This might take some time to calculate.

CSGEvaluatorStep15.JPG

Now the object is finished.

CSGEvaluatorStep16.JPG

Click on the small triangle next to the newly created "intersection" node to see the consiuents of the final object.

CSGEvaluatorStep17.JPG

As you can see you can hierarchically create complicated objects. In this tutorial we didnt use the "union" operation but I guess you can figure out what this one does by yourself. Also I should mention that each of the three operations (union, intersection and difference) can have as many children as you like! Try it out! Have fun! Be excellent to each other! And create cool RepRap objects.


Note: Screenshots were done on a XP machine because I was away from home and had no other PC available :( I later noticed that this model is a little bit too fragile to be printed on a reprap (yet) so i'll redo the screenshots with better values and free os as soon as i find some idle time --Wizard23 14:16, 17 January 2009 (UTC)


Known Bugs

Objects you want to join need to be at top level in tree

Objects you want to join need to be at top level in the tree. In other words: they should not be children of some other object(s). Otherwise the tree view gets screwed up because the same object appears in two places at once. This is because AoI handles the tree in an "interesting" way.

Workaround

Till the bug is fixed just make sure elements you want to union (or interect or subtract) are in fact at the top level before you union them. Afterwards you can move them around in the tree as you like.

Wishlist

  • Preserve materials when combining objects
  • Don't hide negative object, but set them to transparent.
  • Make window dockable
  • Support Live Duplicates
  • Video tutorial
  • Documentation integrated in AoI
  • Faster CSG evaluation and/or rendering
  • Convenience functions for splitting objects in half for two-component printing