[REQ] GoogleEarth Meshes boolean subtract

[REQ] GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 12:51 am

Hi all... I am working right now on a model where I need to import a huge number of GoogleEarth meshes.

As we all know, you cant perfecly import from GoogleEarth, when you import several meshes, they will usually overlap over each other in several places.

This overlapping causes textures problems.


But you cant boolean subtract one from the other.

I tried the plugins 2D Boolean (which joins the meshes) and Cleanup³. None solved the overlapping problem, as can be seen below.





What am I doing right now? I am using ZORRO to subtract the overlapping parts. But its impossibly huge work, when you have to do it in a model with hundreds of GoogleEarth imported parts. Zorro around the imported area of one mesh, carefully select the triangles you want to delete, manually erase triangles left. Repeat 100 times.

What would make it EASIER the work for people working with lots of GoogleEarth imported meshes?

A kind of boolean subtract, even if not a real boolean subtraction, specially because yes, there is the possibility some faces are not really coplanar and not all vertices of different meshes meet.

What can be done then? Imagine two meshes. They are 2d. The plugin should draw imaginary boxes around one mesh, and subtract the shape of this box from the other mesh.

Done, no more overlapping mesh geometry interfering with textures and everything else.

Can this be done? Thanks.
0
Last edited by Gaieus on Wed Oct 12, 2011 9:38 am, edited 1 time in total.
Reason: Edited the topic subject so that the automated listing won't list it among the plugins.

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby mitcorb » Sat Oct 08, 2011 5:15 am

I have only used the free version of Google Earth for basic purposes, and do know that the Pro Version has some additional capabilities. Your suggestion would be an excellent Native feature, at least in the Pro Version, and would be ideal as native to both versions. Anyway, I vote yes for a plugin like this.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby CadFather » Sat Oct 08, 2011 9:43 am

i use TIG's drop vertices http://forums.sketchucation.com/viewtopic.php?t=39251

then Didier's http://forums.sketchucation.com/viewtopic.php?t=29126#p253563 to recreate the mesh

then drape the borders of the terrains onto the new mesh and project the images onto it.

if the image detail is not so important, you can use a zoomed out view of the whole area (either from GE or stitched later) and paint it over the mesh.
0
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 12:56 pm

thanks, but terrain detail and image detail are important. And when zooming out to get larger areas, you lose both. Didier´s mesh recreation tool loses the image and you have to project it again... very hard when dealing with many different meshes.


my plugin request is not even that difficult I suppose. It doesnt join any mesh nor anything. Just cut one mesh from the other, like a Zorro and delete, automatic, when looking parallel camera from the top!

thanks
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Dave R » Sat Oct 08, 2011 1:39 pm

Are you still using SU7/7.1?

There's better elevation info from Google Maps which is accessed through SU8. Maybe that would eliminate your problems.

G Maps1.png


This is an import from Google Maps of two neighboring sections. I cut the geometry from the smaller section and pasted it into the larger one to check for overlapping faces. There are none.

C Maps2.png


And with textures on you can see by the difference in resolution these were at different zoom settings. I didn't need a plugin for any of this.

Why don't you add your SU version and OS to your profile?
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby jolran » Sat Oct 08, 2011 2:52 pm

2d boolean only works on "flat" geometry, I'm afraid.

Hint, the name: 2D boolean.

I suspect a terrainmesh is a "3d geometry". Even though it's just a surface you would have to base calculations of 3 dimensions cause of elevations and such.

Maybe you could build a box "underneath" the surface and do standard boolean on that?
0
User avatar
jolran 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby TIG » Sat Oct 08, 2011 3:15 pm

Can't you simply group the two mesh groups together and explode them together inside the new group - then use one of the many erase-coplanar-edges tools available or manually erase unwanted edge divisions...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Chris Fullmer » Sat Oct 08, 2011 4:32 pm

What if the plugin sort of turned the terrains into volumes by drawing vertical faces downards on the sides, and then a face on the bottom to close the whole thing off into a sketrchup solid. Then use the solid tools to boolean add them together.

That could work. It would be a plugin for pro users only though because of the solids tools usage. And I'm not sure how smart it would be about the GE image emerging. But it could work......maybe.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 5:36 pm

Dave R wrote:Are you still using SU7/7.1?


no, I am using SU8


There's better elevation info from Google Maps which is accessed through SU8. Maybe that would eliminate your problems.


quite the contrary. The problem is even bigger with SU8.

with SU7, you could get a piece from GoogleEarth, than use the arrow keys to go sideways, and you could get two pieces that would overlap in just one side.

with SU8, you dont use GoogleEarth. Everytime you go grab a new terrain mesh, the screen resets to the original land piece position, and you cant scroll with the arrow keys... you must scroll with the mouse, sometimes the next piece will be a little up, or a little down, as well as overlapping on the sides.


G Maps1.png

This is an import from Google Maps of two neighboring sections. I cut the geometry from the smaller section and pasted it into the larger one to check for overlapping faces. There are none.


they are overlapping a bit on the last row of triangles. The textures will flicker since they are coplanar faces.



Why don't you add your SU version and OS to your profile?


Windows 7, SU8.

jolran wrote:2d boolean only works on "flat" geometry, I'm afraid.

Hint, the name: 2D boolean.


yes, I know. I used the 2d Boolean plugin. But it doesnt subtract one from the other. It joins the two meshes. The coplanar faces remain. As I showed in screenshot above.

I suspect a terrainmesh is a "3d geometry". Even though it's just a surface you would have to base calculations of 3 dimensions cause of elevations and such.


oh, I see where you are getting

Maybe you could build a box "underneath" the surface and do standard boolean on that?


not practical when you have to deal with dozens or hundreds of different meshes.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 5:40 pm

TIG wrote:Can't you simply group the two mesh groups together and explode them together inside the new group - then use one of the many erase-coplanar-edges tools available or manually erase unwanted edge divisions...


already tried it, both with 2D Boolean (which joins the two groups into one with everything exploded inside) and also by joining the two groups and exploding the stuff inside.

then using CleanUo³. For some reason, the coplanar faces of meshes do not disappear.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 5:41 pm

Chris Fullmer wrote:What if the plugin sort of turned the terrains into volumes by drawing vertical faces downards on the sides, and then a face on the bottom to close the whole thing off into a sketrchup solid. Then use the solid tools to boolean add them together.

That could work. It would be a plugin for pro users only though because of the solids tools usage. And I'm not sure how smart it would be about the GE image emerging. But it could work......maybe.


maybe it could work. It doesnt even need to be a real boolean. Wait a bit, I will try to draw what I imagined.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Dave R » Sat Oct 08, 2011 5:45 pm

AcesHigh wrote:they are overlapping a bit on the last row of triangles. The textures will flicker since they are coplanar faces.


There weren't any overlapping faces in the example I posted and no flickering as I orbited
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 6:03 pm

two different meshes with overlapping parts. Notice the bounding boxes. Imagine the bounding boxes as the areas where one mesh should be cut from the other.



MAYBE the bounding boxes for the operation should be a bit higher and lower than the real ones, I dont know... if the lowest or highest areas of the mesh are in the border, the cut between two meshes would be more "garanteed" if the bounding box was a bit larger in the vertical?



subtract one mesh from the other. In the example, I simply deleted the triangles, but this doesnt work in real life, because the triangles in one mesh dont quite match the triangles from the other mesh, and a gap between the two meshes may appear (or they still may overlap).

the perfect solution is to ZORRO out one mesh from the other and then delete the overlapping triangles.

I imagine one bounding box exactly ZORROING through the other mesh, and then all the parts of the second mesh, which are inside the first mesh bounding box, being deleted.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 6:07 pm

Dave R wrote:
AcesHigh wrote:they are overlapping a bit on the last row of triangles. The textures will flicker since they are coplanar faces.


There weren't any overlapping faces in the example I posted and no flickering as I orbited




to me, it seems clear the red marked area is overlapping each other... there is a mix of dark and light green triangles there, thats usually what happens when there is overlapping faces, and when you orbit, there is flickering between the triangles, since the program doesnt know if it displays the triangles of one or the other mesh.


if it didnt happen to you, you were lucky. I made several tries with both Sketchup 7 and 8 and it always happens.

either way, you have only two meshes, so only a small part of each mesh overlaps the other. Its easy to overlap so little when you have only two small meshes. When you try to mount a giant gigsaw puzzle by having to select dozens of different meshes, you will end up with huge parts overlapping each other, and you will see the flickering when getting near and moving the camera (or even when importing to other program and rendering)
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Chris Fullmer » Sat Oct 08, 2011 7:47 pm

As I recall, what Google had said about importing GE terrains in SU8 is that now it is much more accurate, because it now imports the actual Google Earth geometry. So therefore, terrains should match up perfectly.

So when you import adjacent terrains, even if they are net perfectly aligned, the vertices should align perfectly, because it is importing the Google Earth geometry.

The one MAJOR exception is that they limit the amount of vertices imported to 1,000. So if the snapshot includes more than 1,000 vertices, then SU will use its own algorithm to simplify the mesh. This simplification can reduce vertices, move their position on the x,y AND Z directions, and that will cause the overlapping vertices to not align.

I had written a tool at one point that would help test it the terrain had been downsampled by SketchUp, so I would know that I needed to zoom in closer to get a higher resolution terrain. Because again, theoretically, if SketchUp does not downsample the terrain, then the vertices really should align perfectly.

I'm not completely sure that all of the above is true. It is largely my recollection of what they had told us.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 9:47 pm

hi Chris. I just imported two small GoogleEarth meshes, using Sketchup 8.

600 triangles each (i suppose... each one had 300 faces).

still no luck. There was overlapping and nope, the triangles from each mesh did not mach perfectly the triangles from the other mesh.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Chris Fullmer » Sat Oct 08, 2011 10:39 pm

AcesHigh wrote:hi Chris. I just imported two small GoogleEarth meshes, using Sketchup 8.

600 triangles each (i suppose... each one had 300 faces).

still no luck. There was overlapping and nope, the triangles from each mesh did not mach perfectly the triangles from the other mesh.



Well, there goes that theory! Did you try the manual way I described? Maybe I'll try that right now.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby Chris Fullmer » Sat Oct 08, 2011 11:03 pm

bleah, the edges are not necessarily co-planar. So its not easy to drop vertical lines at the corners and turn the thing into a big cube.

Bummer,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Sat Oct 08, 2011 11:38 pm

Chris Fullmer wrote:bleah, the edges are not necessarily co-planar. So its not easy to drop vertical lines at the corners and turn the thing into a big cube.

Bummer,

Chris



I would give you some suggestions... if I even knew what you mean :mrgreen:

doesnt Sketchup have absolute world coordinates? Wouldnt the vertical lines just drop till a specific absolute world coordinate, at all 4 corners of an imported mesh? :oops:
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby sdmitch » Mon Oct 10, 2011 4:59 pm

Here is how I did it. I created and grouped the four vertical faces surrounding the 1st terrain mesh using the bounding box corners. Then I did an intersect_with the faces and the 2nd terrain group and added the intersection entities to the entities of the 2nd terrain group. I then searched the entities of the 2nd terrain group for hidden edges that fell within the bounds of the 1st terrain group and deleted them.
0
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Mon Oct 10, 2011 5:57 pm

you did that manually?
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby sdmitch » Mon Oct 10, 2011 6:04 pm

AcesHigh wrote:you did that manually?


No, with a plugin that I threw together last night. Check your PM inbox.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Mon Oct 10, 2011 6:56 pm

wow, thanks a lot!

it works flawlessly!

does it makes any difference which mesh I select first and 2nd?

how the plugin decides from which mesh it will subtract and which one it will keep intact?


this is important because sometimes you may have two meshes at different resolutions... and you may want to keep the higher resolution mesh.

I just made a test where the smaller, hi-res mesh was almost entirely deleted (only left a thin strip, that was outside the bounding box of the bigger mesh), while the ideal solution would be to keep the higher res mesh and cut the hole in the bigger, lower res mesh.


again, thanks a lot!
0
Last edited by AcesHigh on Mon Oct 10, 2011 6:59 pm, edited 1 time in total.

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby sdmitch » Mon Oct 10, 2011 6:58 pm

It all depends on the order that it finds them in the model so the selection order doesn't matter.

Now that I know that order might be important, I will add an input so that the default order can be reversed.
0
Last edited by sdmitch on Mon Oct 10, 2011 7:15 pm, edited 1 time in total.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Mon Oct 10, 2011 7:13 pm

sdmitch wrote:It all depends on the order that it finds them in the model so the selection order doesn't matter.



thanks. Can you make it matter? I was editing my above message while you were writing here, and I said the reason the order would be important.


btw, I also noticed there is usually a small gap created between the two meshes. Maybe the bounding box from Sketchup is not perfectly parallel to the mesh edges?

I am also attaching two meshes where some triangles disappear when running the plugin. Maybe if we could invert the order it result in no missing triangles, I am not sure.
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby sdmitch » Mon Oct 10, 2011 7:26 pm

Yes there are sometimes tiny usually vertical gaps because the meshes aren't exactly the same vertically or horizontally in the overlap areas.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby sdmitch » Mon Oct 10, 2011 7:42 pm

Looks like I need to extend the faces vertically especially on the low side because, in yout test model, the bounding box of the mesh on the right surfaces momentarily on the mesh to the left which would result in some triangles along that edge not to be "cut" by the intersection.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby driven » Mon Oct 10, 2011 8:09 pm

if you view an 'Add Location' 'Terrain' with 'Top View' [ON] + 'Parallel Projection' [ON]+ 'Hidden Geometry' [ON] + 'Face Style .. Shaded' you will see that the mesh is regular EXCEPT for the border.

If you 'Unlock' this 'Terrain' then select all followed by alt/shift/selection-Box over the good mesh it will leave the borders selected for deletion.

The is under all the GE terrains, if you delete the borders, this good mesh will align with its neighbors.

A useful plugin only needs to 'Unlock Terrain' >> 'Select Borders' >> 'Delete Border Mesh'.

When you do this to a set of overlapping terrains they do mesh, but you can also delete the overlaps before exploding all into a new single mesh. I found I rarely needed to even intersect after this process.

I've got a half done tutorial if your interested.

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Mon Oct 10, 2011 8:17 pm

the new version is working very well. The ability to change the order worked well and was definitly important (I made the test with two meshes in different resolutions... first time I tried, the higher res mesh was deleted... I reversed the order and was able to keep the higher res mesh. Even if I have to undo and redo the operation selecting the other option, its still like 1/10th of the time needed to manually ZORRO (use the Zorro plugin) to subtract one mesh from the other. Maybe 1/20th of the time!

Multiply that by 100 different meshes and you get a HUGE time gain!


Thanks a lot. Hope you find a solution to the small gaps betwen meshes, which can be weird when rendering a close-up animation.

if thats not possible I wonder if there is some plugin I can use to create some small cover for the gap? Like, joining the two meshes?
0

AcesHigh 
 

Re: Plugin Request: GoogleEarth Meshes boolean subtract

Postby AcesHigh » Mon Oct 10, 2011 8:21 pm

driven wrote:if you view an 'Add Location' 'Terrain' with 'Top View' [ON] + 'Parallel Projection' [ON]+ 'Hidden Geometry' [ON] + 'Face Style .. Shaded' you will see that the mesh is regular EXCEPT for the border.

If you 'Unlock' this 'Terrain' then select all followed by alt/shift/selection-Box over the good mesh it will leave the borders selected for deletion.

The is under all the GE terrains, if you delete the borders, this good mesh will align with its neighbors.

A useful plugin only needs to 'Unlock Terrain' >> 'Select Borders' >> 'Delete Border Mesh'.

When you do this to a set of overlapping terrains they do mesh, but you can also delete the overlaps before exploding all into a new single mesh. I found I rarely needed to even intersect after this process.

I've got a half done tutorial if your interested.

john



yes, I am interested John. I got a bit lost on your explanation, the tutorial would help.
0

AcesHigh 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: mlydo, rml and 12 guests

Visit our sponsors: