# Does this script exist?

Hi, I’m fairly new to using python within Blender, and I’m wondering if there’s a script out there that would “hollow” out a shape. Say for instance, you have a free-form box and you want the walls of the box to have a uniform thickness all around. The problem is, I’m not sure what such a script would be called. I’m sure someone has already written a similar script, I’m just trying to find it.

hi BANZ111,
look the script “solidify selection” in edit mode menu-mesh-scripts

That didn’t seem to work right at all…

in blender2.45 i’ve just made a cube 1x1x1 and in edit mode started this script after selecting all vertices - it works fine.
What is the problem?

I’m also using 2.45. Try it with a cone: Notice how at the bottom, the width between the inner and outer shape is not the same as the space with the rest?

This is what I think the algorithm for the script should be like:

Step 1: For each face in the mesh, calculate face as extruded from the normal of the primary face. (Extrude each face straight out)

Step 2: For each new face in the mesh, find the point at which each edge would intersect the edge of the neighbor face. (Visualize the line as being infinite in length)

Step 3: Merge the vertices of these faces at these intersections.

In theory, this should work. I have thought up another version that was quite a bit more complex maybe a month or two ago. However, I don’t know jack about Python, so I wouldn’t be able to script it. Also, finding those intersections may involve a tiny bit of math. The advantage here, is that each wall would, by itself, also be a mesh.

Not sure if this is what you are looking for but:

I have at least three different versions there of the script, one moves faces, one duplicates then moves faces, one connects then moves and connects faces. It sounds like what you’d want… but… take a look and tell me if that comes close. We could then work out how to modify it to do what you want

Ok, You guys have been at it longer, but, tell me, so I know better what you saying. Why can’t you just take a shape and extrude, and then scale in?

-Abc

it all depends what you want. my scripts work using BUs [blender units]. If you just scale it works in percentage based on the distance of some center not from the base of every face.

since I don’t know what the original poster wants exactly, I just gave some examples.

it all depends what you want.

This script is so close to the answer, but it HATES tris and acute angles appear narrower at the edges than they ought to be. The process I have found to do this by hand is detailed in this image:

[img=http://img502.imageshack.us/img502/6283/processpj2.th.gif]

Here’s a picture:

b < a because it uses the average center of the mesh to scale in. What I’m searching for is a way to make all the walls equal thickness.

Then try my scripts, they do the “equal distance” thing. Or you can use the blender internal ALT-S [it doesn’t work properly on Mac OS X PPC, which is why I wrote my scripts].

Well, I actually did try your scripts, and it doesn’t appear to keep equal distance around certain corners. Also, Alt-S doesn’t seem to provide any useful results, either. Well, for my project, I can continue to do it the old-fashioned way, tedious as it may be. As I stated earlier, the algorithm for achieving this can be formulated using my guidelines by someone who knows what is in the Blender-Python API. The hardest part may be keeping track of the sides if it’s done within an array, but the advantage here is that only selected sides may be extruded. It really only makes sense to do so in edit mode, since I’ve notice with your script that the vertices selected in edit mode are the only ones affected by the script, which can only be run in object mode. This doesn’t make sense to me. Well, hope this help with some degree of debugging, at least. I realize that the Blender community is founded around critique that promotes improvement for all users.

can you post any examples where my script doesn’t work consistently?

Can you post a .blend where Shrink/Fatten (Alt+S in Edit mode) does not do what you want? I’ve tried it (Win32) with a number of complex shapes, including ones with both convex and concave surfaces in the same object, and it seems to do what you’re looking for, modifying the mesh exactly as you originally described in the three steps, far as I can tell. I haven’t measured the displacement of all faces to make sure they’re exactly the same long all normals, but visually I can see no major differences.

I can imaging very convoluted shapes where Shrink/Fatten may not be optimal due to intersection of the faces as they expand along the normals, but these kinds of topology would be a problem for any method.