The goal is to speed the modeling workflow for solid objects: adding cylinders without ruining you mesh topology.
You can use boolean transformers but the result may be bad and your mesh may be more complex.
The structure of your object will be:
YourMesh
±–EmptyCyl001
____±–Cyl001
±–EmptyCyl002
____±–Cyl002
The material of your mesh will be transparent where your mesh intersect with the cylinder thanks to a group node and using the position of empties.
The fun part is that you can move your cylinder by moving the empties (for the moment only on th yz plane).
The workflow below may seem complicated, but a script (add-on ?) may be used in the future to simplify it by generating cylinders thanks to empty property (size + custom properties), modifying the main material, adding drivers (see below)…
In the example joined I had to scale the second cylinder by 1.01 to avoid a black circle.
Things to do in the future (volunteers accepted!):
modify the material group node to work on all axes (x oriented today)
modify the material group node to use the rotation/location/scale of the principal object (don’t work today)
modify the material group node to make it uasable with other meshes (not cylinder), if necessary
python script/add-on (cf infra)
The workflow may be:
1/ Install object intersection add-on
— see this page http://airplanes3d.net/scripts-253_e.xml
— Big thanks to Witold Jaworski !
2/ Save your work
3/ Make a copy of your mesh on another layer
4/ position the 3D cursor where you want to create the cylinder (intersecting your mesh).
5/ add an Empty, name it EmptyCyl001
6/ add your cylinder. Choose a huge number of vertices. You will need the radius. Name it Cyl001. Parent the cylinder to the empty.
7/ position your cylinder on the x axe, scale it on the x axe and apply (Ctrl +A) the transformations.
—You will need its size (on the x axe).
8/ apply all your modifiers to your mesh.
9/ in object mode :
– select your mesh
— shift select the cylinder
— press spacebar
— choose intersection add-on
10/ in edit mode for the cylinder
— delete all the vertices but the two mesh created (maybe just one mesh created, you will have to extrude it and scale the extruded part to 0).
— press spacebar
— choose Bridge Two Edge Loops add-on
11/append the Ampli material in the blend file joined to this thread and use the material
12/ add your own material
13/change the values for the nodes
— CylinderRadius
— CylinderSize
----- for the position of the Cylinder, you can add a driver (use in the blend file joined), see http://vimeo.com/40389198. Thanks to David Miller, in my opinion one of the best blender tutorial I have ever seen.
----- > CylinderX
----- > CylinderY
----- > CylinderZ
14/ delete your mesh with modifiers applied (see 8)
15/ ShiftD your saved mesh (see 3)
16/ Move your mesh to your original layer
17/ Parent EmptyCyl001 to you mesh
@ajm: yes, but it may become very simple with a script:
just model as usual,
when you want to add/remove a cylinder (or other meshes ?), just add/remove an empty where you want it, parent it to your mesh then launch the script. It will automatically modify your mesh material to add/remove holes, then it will add/remove cylinders and parent them to the empty.
Your initial mesh will remain the same.
that is an interesting technique. I ran into problems with holes in hard object modeling. if there were some sort of script to automate the process, it could prove quite helpful in certain cases
Sorry the picture is a little boring and the colors are ugly but it’s just for test.
The workflow would be;
1/ model your principal object
2/ add empty where you want to add holes with cylinders. you can use rotation and scale of your empty, it will be used to make holes (=transparent section) in the material and create cylinders.
3/ launch the python script:
today it will only create cylinders where the empty are. you have to intersect them with your main object and delete top face.
In the near future I hope to alter the material of the main object, to add/remove automatically the parts that make holes and to add driver (so as to use empty properties to indicate where to make holes).See the blend file with a manual example with 4 holes. It may need PYnodes.
Two problems:
the mesh generated is smaller than the hole when there is an y rotation,
Mapping rotation did not work for me, I had to make a rotate group node (I think I did not understand something)
EDIT 2013-04-09: of course mapping rotation is OK, I will correct the blend file soon and will correct mapping (world instead of local).
a little imprecision in blender 2.66a (I don"t think it’s à bug or it has an impact on my WIP)
when you have a 30° angle (pi/6) in an object and a driver using a variable with that angle, you will have 0,523599094 (0.5235987755982988730771072305465838140328615665625176 with wolframalpha), different at the 6th decimal
It seems like a long process compared to other ways, and what if you need to make something that won’t be rendered in cycles? I think it’s better to just model it out normally. When I make a cylinder hole at an artbitrary angle, I just add a circle and snap it to the surface of the object, then merge the object’s surrounding verts to the circle, then extrude. It ends up looking like this:
puting holes in mesh is pretty simple there are other moddeling problems acctualy very more intresting than this just learn the topoklogy of entering circle to mesh and problem solved.
Not really, when it will work I think it will be slower when you have to make less than 2 or 3 holes, but faster in other cases, thanks to the script.
True, it’s a limit of this method.
The main advantage of modeling with empties is that it is not destructive: you can delete and recreate the (hole + cylinder) without modifying the initial object. It will work also with cube or sphere instead of cylinder.
@Kramon: I disagree.
I think it’s interesting in theory:
by modeling solid objects you reproduce the workflow of creating real material:
start with material like wood, steel,
shape it,
do physical transformation like bend, twist, bevel
making holes (or slicing) is different: you destroy the topology of your real material
so it may be difficult to reproduce the hole in your mesh.
In some cases, especially if you want precise result, I think it’s better to use the solution described in this thread.
You can find here a new blend file with corrections added : you can now grab, rotate and translate you main mesh, the hole will follow.
Things to do:
A simpler way to intersect objects to the main object without modifying the mesh of the main object, using DynamicPaint:
1/ create a scene with a principal Object Princ (in my example : cube subsurf level 2 applied and another modifier subsurf non applied)
2/ UV Map Princ with option Smart UV project
3/ create others objects Sec_001, … (in my example: Monkey, Cube and Cylinder)
4/ for each Sec_001, …add modifier boolean / intersect Princ
5/ add modifier Dynamic Paint/Canvas to Princ.
Options :
Format : Image Sequence
resolution 4096
Frames End : 1
UV Map : the UV Map you created
PaintMaps :Selected
Dynamic Paint Initial Color: Black
6/ for each Sec_001, … add modifier Dynamic Paint/Brush
Color : white
Paint Source: Mesh Volume
7/ back to Dynamic Paint of Princ, launch Bake
8/ add Material to Princ, see the screenshot. You add to reference the image you created in step 7 to the Image Texture.
9/ for each Sec_001, … apply modifier Boolean
10/ for each Sec_001,… add a transparent material for the part of the mesh intersecting with Princ
11/ Render
Not perfect, I think I need to scale the objects a little.
It may be simplified with a script using empties referencing the objects.
Edit 2013-05-02: a simpler method would be to bake a displacement image in BI and to use it in cycles instead of dynamic painting but for the moment I haven’t got a good result.
Edit 2013-05-09 : step 6 instead of using Distance, ‘Mesh volume’ works perfectly. Step 6 updated