three new scripts, Inset - Normal smooth - Project cursor

I wanted these for a while… so I took some time to code it… thanks ideasman for helping out :wink:

INSET
There’s a couple things that don’t work perfect, but I don’t really have the time to write special exceptions for those.

http://www.alienhelpdesk.com/pages/inset/inset-post.jpg

Find the script and explanations here.
http://www.alienhelpdesk.com/python_scripts/inset

Normal smooth

Doesn’t run perfect either but is very usable already.

http://www.alienhelpdesk.com/pages/normal_smooth/smooth-comparison.jpg

Find the script and usage details here:
http://www.alienhelpdesk.com/python_scripts/normal_smooth

Project cursor

The script puts the cursor at the “intersection of the vertex normals”. Read the page linked below the image for a better explanation.

http://www.alienhelpdesk.com/pages/project_cursor/project-2.jpg

Find the script and usage details here:
http://www.alienhelpdesk.com/python_scripts/project_cursor

Hey Mac, that’s what was missing for me from C4D …
(I learned the scaling ‘soso workaround’ since but …)

awesome!!!

This script is a long time need for many of us!
Thank you so much, macouno!

I’ve made a little test and there’s something not quite right. Please try it with this test file (default values) and see the upper and lower results.

http://uploader.polorix.net//files/134/Inset_test.zip

Thanks guys… I updated the post with another script I was documenting… “normal smooth”

MadCello: I tested and it looks correct to me

This from your file
http://www.alienhelpdesk.com/misc/i_inset-checked.jpg

Some non-PEP ‘enhancement’ proposals (sorry for such intrusion)
couldn’t you f.e. replace the line 76 (and adequate below) in inset script with something like

if (v1in and v2in) in [v.index for v in f.verts]: return True

line 65 could be squeezed similarly …

added the functions: warning - not tested, just a quickie edit…


## Find out if a vert is an outer vert (connected to a non selected vert by an edge)
def IsOuterVert(me, vIn):
	for f in me.faces:
		if not f.sel:
			if vIn in [v.index for v in f.verts]: return True
	return False

## Find out if an edge is an outer edge (connected to a non selected face)
def IsOuterEdge(me, v1in, v2in):
	found = False
	for f in me.faces:
		if not f.sel:
			if (v1in and v2in) in [v.index for v in f.verts]: return True
	return False

Yeah could be done :wink: Though I’m mostly happy I have it working… a lot can be optimised code wise…
The downside of your version is that it always checks both v1in and v2in and in my case if the first check is not succesfull it just skips the second one… no idea which would be more efficient, but that’s why I had it multilined

I’m hoping some people may have some input in correctness of the actual results though…

I had a closer look at MadCello’s example and he’s right… it’s not 100% correct. Sadly I don’t have the time to perfect it… So hopefully someone else can help out… But I really think both these should be properly coded in C and added to blender as internal functions. I need em a lot :wink:

+1 me too.

Shit I should dig nagging I did in Elysiun days with “feature requests”. For “extrude inner” which is/was C4D term for insetting.

Well thanks for getting the initiative up at least (even if it doesn’t _really_work_as your mommy told it should). Maybe you should nag Cambo to get someone porting that to C …

I’ve been working on a simplistic python code reformatter on-and-off lately and gotten in the habit of writing condensed-yet-almost selfdocumenting code. Because I wouldn’t understand shit if I didn’t do so.

macouno, i’ve tested with 2.44 but it gives me no functional erros.

For me, the 2 small edges at bottom and at top have diferent lengths.
Your’s have same length?

if you test with a higher value (.3), you can see with the eye (almost 25% diferent), and the lateral inset have diferent distances.

yes they are different for me too… don’t know exactly why… can’t fix it right at the moment, but will keep your file around for future testing.

great scripts again! thanx. Hope I will use them in my work. looking forward to see you again some day on some blender event. :slight_smile:

thanks.

Ah and I updated the online version of the inset script… it’s almost 4am here and I had just brushed me theeth as I realised what was wrong. I had a set value in there for 180 degree angle cases which was no longer nessecary. So MadCello… it’s fixed now for your mesh hehe

So now Inset.2.py is downloadable at the top of this page: http://www.alienhelpdesk.com/python_scripts/inset

Woops :wink:

Works like a charm! :eyebrowlift:

hi macouno,

thanks a lot for the scripts.i will try it.:slight_smile:

Heh… well I don’t want to spam the entire forum but I’ve been busy… third new script added… read the first post in this thread.

mac

You are really producing scripts :slight_smile:

It’s a pitty that normals intersections does not give “center point” of spheres in almost all of the combinations.

Thank you for this wonderfull scripts!

Thank you macouno,

very nice of you to share all this with us :slight_smile:

The downside of your version is that it always checks both v1in and v2in and in my case if the first check is not succesfull it just skips
afaik pyhon evaluates from left so this should be a nonissue (if first/left op is False then it’s False, dropped) - plus if the check is inline stuff should be faster in any case - no calls to local vars. Saying “should” because I havent really tested, that’s assumed as being “by the book” - plus saying again: haven’t tested.

For same reason I didn’t want to squeeze the f.sel check, as this would imply the comprehension/other checks being performed for all faces and not only selecteds.

Purely hypothetically. But very likely to work as advertised - if there wasn’t any logical/syntax mistakes in it.

MadCello… it would help if you showed when it doesn’t work for you…

UPDATE: Had a look and fixed and uploaded… version 2 of project cursor is now online. Apparently lineintersections really don’t like opposing vectors. So it should work fine on Full spheres and such now as well.

macouno, i was not saying that it works bad, i was complaining about mathematical reality of vertice vormals in the regural sphere. Only the Icosphere as vertice normals aligned with the center.

p.s. one thing that i notice, while i’m writing this reply, is that cursor disapears if you tested it with a 2d circle, and the LMB cannot show it again, only with Snaps.