Addon : Edge Edge intersection boolean tool (2.55)

December 16 2010 : after careful consideration i have started a new thread with updated script(s) here
http://blenderartists.org/forum/showthread.php?t=204836

Please replace the code by a better one e.g. my vector suggestions and removing def abs (unnecessary).
(coming from … the other thread ;))

yep, soon! with refactoring. OK. i updated! and changed the original post! Thanks again pkhg

Now i’m stuck turning this into an addon, so i can save it to my default startup configuration.
here’s what i got so far ( this is supposed to add itself to the w menu while in editmode )
I’m looking at other scripts and don’t fully get what i’m doing wrong, i must be slow :slight_smile:

any pointers are appreciated!
-EDIT , updated first post.

Easy error: Read the error message in the console carefully!
You need two parameters in poll!
and it worked if I changed @staticmethod into @classmethod


    @classmethod 
    def poll(self,context):
        obj = context.active_object
        return obj != None and obj.type == 'MESH'


It looks good, but is not quite good …try examples and move intersectionpoints … WRONG conection (not to both ends?)

http://i56.tinypic.com/2vjosie.jpg

sweet! thanks again pkhg! i hadn’t opened blender with a console since writing the non-addon part of the script. The link is now updated to reflect the current state of the script. and also the code above is now corrected.

EDIT thanks for the bug report there pkhg, i’m going to work on that. While the first one appears to be undefined/undocumented behaviour, it seems the LineLineIntersect code behaves in a very desirable way in that instance. i was going to add a mode to intersect two edges if they dont meet yet. so i’m happy with that functionality. It stays :slight_smile:

checking the second image now. i see… i see. well, i’ll have to think about that situation…
Thank you for bringing it to my attention. late edit : this no longer is a problem. one does not need to apply transforms

running the Slice at Intersection option:
on two parallel edges does nothing. ( maybe this should report in the notice area )
on two crossing/intersecting edges will create a slice in the geometry.
on two edges that don’t intersect, but are not parallel will result in the eventual (projected) intersection point being created.
the last option does not remove the initial edge boundaries. This, i must conclude, is also desirable behavior, in some cases and not a great burden to remove the old edges if the effect is not desirable.

I think i’m finished with this one, unless it creates weird geometry for someone

At my Blenderversions W32 Vista, Blender opens always a second window, which I called ‘console’ …
Do not know how to call it differently, because print results occur there too.

cvan you explain how you run this script

i mean do you have to start it in the addons panel meaning that it has to be installed in the addons folder before then
select some edges in viewport or run it from spacebar to activate it ?

Thanks and happy 2.5

Sure! And be aware it must be a 2D mesh of …

@pkhg, yes, i run on linux using xterm now as my console. i will keep it handy for debugging.

@rickyblender, add to addons_contrib , it will appear in the mesh section in blender when you restart the program, tick it, then go to editmode in a mesh, select two edges that intersect, hit W, then at the bottom ‘Slice at intersection’

i may still modify some of the code to behave slightly differently on ‘potential intersections’ but for now i’m am totally using this every day :slight_smile:

by default any two lines that intersect must be on one plane. in this it does not matter if that plane is tilted.
try adding this :

http://img716.imageshack.us/img716/4223/intersects.png

just saw something new here in add ons folder

we have new sub folder which i had ask several months ago and now seems to be added
WOW that’s great i think!
can you explain what’ the idea behind these sub folder!

now where do you find this add to addons_contrib thing

is this a new folder i have to create or existing one?

Thanks

i use a recent graphicall.org build, and addons_contrib is located here
http://img80.imageshack.us/img80/8542/filebrowser254.png

wow must be moving fast

well yesterday i got 32130 and dont see this new folder !
and contrib sub folder is not there !

which version do you have - i’m on vista

salutations

linux amd64 build, i can confirm that it runs on 32130 32bit vista.
but you do have to add addon_contrib to that folder and stick the py inside it. then start blender.

here is a pic of my folders for this new 32130

http://cid-348ad7d85dee0c79.photos.live.com/self.aspx/2.54gen1/Capture.JPG

and i check when opening the flash window and it is the right version

don’t see this new folder !

don’t know i’ll try to get the next version later this night
may be it will be there!

salutations

ricky, make the folder yourself. or add the py to the addon folder. it doesnt matter

i got 155 and it does not exist yet for vista!

did a test with new folder and it does not see it
so i added it to the addons and it’s working

i did a test with a plane extruded one line to cut another edge and hit W to intersect but did not see
the edge being subdived

is it supossed to sudivide the crossing edge ?

Thanks

salutations

show me an image of what you are doing, also . try the doing operations like those in my images to get an idea :slight_smile:

i tried with different shapes like this one here in pic with a simple plane
extrude one corner to cut another edge
http://cid-348ad7d85dee0c79.photos.live.com/self.aspx/2.54gen1/z1.JPG

the extruded line is in same plane so it should intersect the other edge

it looks like the model you add but i does cut the edge

and then tried with a cube also but did not work either

thanks and happy 2.5