[Plugin] 2dBoolean ver1.3.1 beta UPDATE 20 dec 2013
-
The .flatten! combines nested arrays
The .uniq! removes duplicates
Also [not applicable to THIS tool] .compact! would remove 'nil' array elements, or .sort! puts the list 'in order'...Now to the chase.........
I also see this 'unexpected' possibility of faces we want to keep being false-flagged as 'holes'.
So we need to trap for real 'hole' faces - the outer_loop edges will always have two faces...faces2go=[]### rather than erase as we go we'll collect them... faces.each{|gface| ### we skip the gface IF it's NOT a 'hole' ### just 1 one-faced edges is enough for != hole hole=true gface.outer_loop.edges.each{|e| if e.faces.length==1 hole=false break end } next if not hole ### pt=gface.bounds.center.project_to_plane(face.plane) if face.classify_point(pt)==Sketchup;;Face;;PointOutside tedges << gface.edges faces2go << gface ### save them up end }
THEN erase_entities on
faces2go
and then erase! any of thetedges
that don't have a face... -
@unknownuser said:
The .flatten! combines nested arrays
The .uniq! removes duplicates
Also [not applicable to THIS tool] .compact! would remove 'nil' array elements, or .sort! puts the list 'in order'...Great to know. Will be useful.
Your code works! Almost
Like with the method I used before(face.clone holes.centers), I'm experiencing some faces don't get erased. (Having a model that look like a swiss cheese)
I wonder why this happends. Your code should be working...
For ex. I run the plugin once. Maybe 3 faces are not deleted but the edges are trimmed to fit. I run the plugin again with the component selected, then it is OK!
It is like it needs another rescue operation? Or maybe run the last command twice? Seems excessive..
I will check my code as well. Been moving snippets back and forth, it need some cleaning up.
And another thing. Was it GO for NOT using faceclone? Intersect with SS or Glue face?
I havent implemented that yet, still using face.clone. Shouldent matter in this regard...
-
Think it is ok...
Breaks sometimes, but only if using a simple squarish component. One have to consider what this tool is going to be used for.
-
Try intersecting the group.entities with the face.edges+[face] twice ?
Will make it slightly slower... BUT it might fix the potential glitch ?? -
Yes TIG, I think you are on the right track there! Good thinking.
I was about to report that intersection is not working properly. One cannot erase a face if it can't be selected
This can be due to my code being a bit shabby at the moment, moving stuff back and forth as mentioned.
I will "clean it" and report back later.
-
2 intersection gave a big improvement! Not 100% accurate, but I think it's good enough. One can force it by selecting the component and running the plugin again. It almost always sort out the fuzz, then.
Still intersecting with face.clone. Had some problem with intersecting with Sketchup.active.model selection...Expecting entitiy something..
Speed is better, even with 2 intersections
Did a test with a "heavy" component, ver 1.1 VS current dev.code. VER 1.1: 41.483 seconds. current dev.code: 4.278 seconds
Do we move forward, TIG? Or delve deeper in this problem, to make perfection?
-
Ok, I have put out the new version 1.2 for testing. So you have something to play with this weekend.
It should be an improvement..KEEP THE OLDER VERSION AT HANDS! I won't be able to fix issues this weekend
Thank you TIG for all the help.
I haven't optimized the iterator exactley as TIG suggested, so that can be improved...
There are more issues to deal with later on.. But let's not spoil all the fun.
-
Joel, thanks so much for this plugin!! I have 2d elevations that I needed to glue to a massing, and this works absolutely perfect for my needs. Good work!
Andy -
can anyone check if this pluging works with meshes?
when importing several pieces from GoogleMaps, the pieces usually end overlapping each other, causing texture errors.
You cant use 3D boolean because obviously, meshes, are not solids.
So I would usually "zorro" the different meshes, and cut the parts that overlap. Obviously, a HUGE work when you are dealing with dozens of different GoogleEarth imported meshes. If this plugin works with those, it will be great!
-
Hey, I missed some posts in here!
Andybot. I'm glad someone have use for this plugin! Appreciate it!(we all know TIG's part of this of course)
AcesHigh.
I've seen your request in other post regarding this subject. Like I said. I think it lies more in the 3d domain, since the surfaces are not flat.
IF the intersecting geometry would be flat at intersectionpoints, 2dBoolean should activate. But I see your case you would need a subtraction-algorythm.
At this point 2dboolean only subtracts geometry outside the face it's lying on(or selected face).
What you are asking for is really needed, and I will see what can be done about that in the future. I'm kinda busy at the moment.
Have to deal with Hatchfaces webdialog, which unfortunaly proves very difficult.
I thought I only had to learn Javascript, HTML, CSS and JQUERY . But there is need for some JSON and maybe AJAX as well. Kinda much required to make a simple dialog if you ask me. -
Nice update.
But! If you are gonna further developp this tool, and display it in this thread with my icons included. Please don't scramble the code, so other can benefit from your code like you did on mine and Tig's.
Besides your plugin will be lost in this thread posting it here.
Best regards.
-
Sorry, but actually I prefer the code scrambled. The code is not very optimized because I did it to translate to C after.
I don't use any line of your code. I used a simplicans planar theory. (I taked your one icon, feel free of use my icons)Best regards
-
@juantxo said:
Sorry, but actually I prefer the code scrambled. The code is not very optimized because I did it to translate to C after.
I don't use any line of your code. I used a simplicans planar theory. (I taked your one icon, feel free of use my icons)Best regards
watch out, the 's around here will unscramble your code and make sure you're telling the truth
-
@unknownuser said:
I don't use any line of your code
Ok. If you say so.
@unknownuser said:
I taked your one icon, feel free of use my icons
That's ok. I don't mind that. 2 min PS for me.
@unknownuser said:
Sorry, but actually I prefer the code scrambled
Ok, about that. I find it somewhat strange to post stuff for free, scrambled. thats not very helpful for other programmers.. Personally I rather tell to much then nothing at all.
-
Actually I'm working in 2D boolean of polygons in Sketchup because I need for other stuff. I did this plugin using simplicians theory.
May be could be usefull for someone.You need to select two groups with a general planar polygon.
General planar polygon = A single polygon or a polygon consisting of a set of non-intersecting single polygons. -
New version 1.3.1 added:
http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=39661
Whole lot is rewritten so there may be lot of things broken. I suggest a lot of testing and report back bugs and wishes
Intersections should now be a Little quicker. And some new stuff as well.
Make sure to read the manual in second post.
Will try and add to pluginstore later.
-
-
I added it to the SketchUcation PluginStore for you...
http://sketchucation.com/resources/pluginstore?pln=2dBoolean
You might want to edit the listing and add documentation, release notes etc... -
Thank you TIG. Really appreciate it!
I havent done any update for a long time and must get up to date with how the pluginstore works, more in detail.
I suppose I should move the manual there to, perhaps ? Did not manage to downsize it to less then 1.8 mb.
Advertisement