[Plugin] Hide Overlapping Geometry (Updated 20150511)

[Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby CAUL » Sun May 03, 2015 6:33 pm

Hide Overlapping geometry is a script that, well, hides overlapping geometry. It works as follows:
1) Overlapping faces are always hidden. Two faces overlap if they have exactly opposite normals and share an interior point.

2) If two faces overlap, the script will check their edges for overlap. An edge will be hidden if it overlaps another edge and A) is connected to only overlapping faces, or B) is connected to overlapping and non overlapping faces where the latter have an angle between the normals < 22.5 degrees.

The problem is somewhat subtle and it's not always obvious what to hide. The script works best with solids. If a face or edge is hidden, it will be hidden in all group and component instances.

Usage

Select one or more groups or components and run the script. The script appears as "Hide overlapping" in the Extensions menu. If only one group or component is selected the option
"Hide within nesting" has to be true.

v0.0.2

Interface added with four options:
1) The smooth angle can be explicitly defined
2) The geometry can be transfered to a specific layer
3) Groups and components can be made unique
4) Groups and component can be compared within the same nesting
3
Last edited by CAUL on Mon May 11, 2015 1:33 pm, edited 3 times in total.

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby TIG » Sun May 03, 2015 6:39 pm

Please always attach your Plugin's RB [without versioning in its filename] as an RBZ [edit your post accordingly] - so then it might then be considered for inclusion in the SCF PluginStore.

Contact Rich O Brien by PM, asking to become registered as an 'SCF PluginStore Author' so that you can publish your Plugin[s] there...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby DOD3R » Mon May 04, 2015 3:01 am

wow, yes yes yes,
dream come true.

Thanks for such a great plugin.

D.
0

DOD3R 
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby pilou » Mon May 04, 2015 8:51 am

I don't very well understand that this script must do! :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby CAUL » Mon May 04, 2015 9:29 am

pilou wrote:I don't very well understand that this script must do! :)

In your example the faces intersect. Overlap is when the faces are aligned (and have exactly opposite normals) and occupy the same space. In the image below there are 16 instances of a solid group. For visual reasons the seams between the groups should be hidden, and the way to do this is to hide the overlapping faces and edges. If you select two adjacent groups and run the script the seams disappear.
0

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby pilou » Mon May 04, 2015 10:18 am

Ok! But seems there is a little glitch! ;)
A simple copy box (Group)
overlap1.gif
0
Last edited by pilou on Mon May 04, 2015 10:53 am, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby Dave R » Mon May 04, 2015 10:41 am

This works great, CAUL! Thank you!
1
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby pilou » Mon May 04, 2015 11:16 am

AAAAAAAAAAaaaaaaaaaaahhhhh! :D
But this is curious!
Better if that work in any positions! :)

Now seems that is a glitch inside the "gifcam" ! :roll:
Seems it don't like the rotations! :mrgreen:

overlap2.gif
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby Dave R » Mon May 04, 2015 12:07 pm

Why don't you use Flip Along instead, Pilou? :roll:
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby JQL » Mon May 04, 2015 12:42 pm

pilou wrote:Ok! But seems there is a little glitch! ;)
A simple copy box (Group)
overlap1.gif


I bet if you double click edit any of the two groups, prior to running the script, you will get the result you expect.
1
User avatar
JQL 
Premium Member
Premium Member
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby pilou » Mon May 04, 2015 12:57 pm

I bet if you double click edit any of the two groups, prior to running the script, you will get the result you expect.


YEP! Excellent! :thumb:
What make exactly this double click ?

don't you use Flip Along instead

I take always the bad color anytime the first time! :)
I prefer mirror :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby Dave R » Mon May 04, 2015 1:01 pm

Mirror is nice but Flip Along can be done in a single key stroke.
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby JQL » Mon May 04, 2015 1:56 pm

pilou wrote:YEP! Excellent! :thumb:
What make exactly this double click ?


When you create a group and copy it, it is just like any component, and you get duplicate instances of the same definition (duplicate groups behaving like duplicate components).

However, if you double-click it, you edit it, and even if you do nothing on it, it is made into a different definition, therefor "unique".

What happened is that the plugin hide the face of a group behaving as a component and in doing so it hid the face of both components. If you'd flipped it like Dave suggested, you wouldn't see the problem.
0
User avatar
JQL 
Premium Member
Premium Member
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby pilou » Mon May 04, 2015 2:33 pm

if you double-click it, you edit it, and even if you do nothing on it, it is made into a different definition, therefor "unique".

I don't believe that many people knows that! :o
(maybe in the manual but don't have the luck to see it! :)
It's the Dohdoh Duh of the day! :thumb:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby tt_su » Wed May 06, 2015 11:09 am

JQL wrote:
pilou wrote:YEP! Excellent! :thumb:
What make exactly this double click ?


When you create a group and copy it, it is just like any component, and you get duplicate instances of the same definition (duplicate groups behaving like duplicate components).

However, if you double-click it, you edit it, and even if you do nothing on it, it is made into a different definition, therefor "unique".

What happened is that the plugin hide the face of a group behaving as a component and in doing so it hid the face of both components. If you'd flipped it like Dave suggested, you wouldn't see the problem.

This isn't documented well in the API either. Something we need to improve. Developers need to call group.make_unique to ensure groups are unique before modifying them.
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby JClements » Sat May 09, 2015 4:40 pm

I noticed that if the normals of the two overlapping faces are the same (both are "pointing" in the same direction), then the script fails.
0
John
Illustrator
Beaverton, Oregon
User avatar
JClements 
Premium Member
Premium Member
 

Re: [Plugin] Hide Overlapping Geometry (v0.0.1)

Postby CAUL » Mon May 11, 2015 1:31 pm

JClements wrote:I noticed that if the normals of the two overlapping faces are the same (both are "pointing" in the same direction), then the script fails.

This is not really a bug (nor a feature). It's mentioned in the initial post. The reason for this behaviour is that it's a very convenient simplification from a developers point of view. The extension is centered around solids with consistently oriented faces so it's a reasonable simplification.
0

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby Pixero » Mon May 11, 2015 2:27 pm

Thanks for version 2. That seems to work well now. :thumb:
Would you please also add a "Show overlapping edges"?
When for example designing a multi floor facade it would be great to hide the edges to see how the whole facade looks and then it could be useful to turn the edges back on for viewing the different floors.
0
User avatar
Pixero 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby CAUL » Tue May 12, 2015 4:47 pm

Pixero wrote:Thanks for version 2. That seems to work well now. :thumb:
Would you please also add a "Show overlapping edges"?
When for example designing a multi floor facade it would be great to hide the edges to see how the whole facade looks and then it could be useful to turn the edges back on for viewing the different floors.


Maybe the possibility to move the geometry to a specific layer is enough? Then you can turn the visibility of the layer on and off.
0

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby Pixero » Tue May 12, 2015 5:10 pm

Yes that would do. :D
0
User avatar
Pixero 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby JQL » Tue May 12, 2015 7:35 pm

If you're developing that, could we define the layer's name by tinkering with rb?
0
User avatar
JQL 
Premium Member
Premium Member
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby ntxdave » Tue May 12, 2015 8:04 pm

Feeling really dumb. I created a box and then duplicated it and drug the corner of one box to the corners of the other box. I tried double clicking one of the boxes and then used the selection box to select both boxes. When I clicked on the Hide Overlapping Geometry, the overlapping geometry was not hidden.

I tried Dave's approach of flipping one of the boxes (that was the only change), clicked the Hide Overlapping Geometry and it worked as it should.

Not sure what I did wrong with the first approach.
0
User avatar
ntxdave 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby CAUL » Wed May 13, 2015 8:01 pm

JQL wrote:If you're developing that, could we define the layer's name by tinkering with rb?


The current version lets you select an existing layer.

ntxdave wrote:Feeling really dumb. I created a box and then duplicated it and drug the corner of one box to the corners of the other box. I tried double clicking one of the boxes and then used the selection box to select both boxes. When I clicked on the Hide Overlapping Geometry, the overlapping geometry was not hidden.


I'm not sure what you're doing wrong (if anything). Do you have a sample model?
0

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby ntxdave » Wed May 13, 2015 8:25 pm

CAUL wrote:
ntxdave wrote:Feeling really dumb. I created a box and then duplicated it and drug the corner of one box to the corners of the other box. I tried double clicking one of the boxes and then used the selection box to select both boxes. When I clicked on the Hide Overlapping Geometry, the overlapping geometry was not hidden.


I'm not sure what you're doing wrong (if anything). Do you have a sample model?


I have attached a VERY simple model that just has two boxes. Flipping one of them works fine. Where I am messing us is with the double click method. When I double click on one, how do I then select the other one so that I can then apply your plugin to the 2 of them. This is making me feel really dumb........
0
User avatar
ntxdave 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby CAUL » Fri May 15, 2015 9:41 am

ntxdave wrote:I have attached a VERY simple model that just has two boxes. Flipping one of them works fine. Where I am messing us is with the double click method. When I double click on one, how do I then select the other one so that I can then apply your plugin to the 2 of them. This is making me feel really dumb........

You should not enter (double click) any of the components, just select the two components and run the script.
0

CAUL 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby ntxdave » Fri May 15, 2015 5:39 pm

CAUL wrote:
ntxdave wrote:I have attached a VERY simple model that just has two boxes. Flipping one of them works fine. Where I am messing us is with the double click method. When I double click on one, how do I then select the other one so that I can then apply your plugin to the 2 of them. This is making me feel really dumb........

You should not enter (double click) any of the components, just select the two components and run the script.


The problem I am having is exactly as Pilou described in this post:
pilou wrote:Ok! But seems there is a little glitch! ;)
A simple copy box (Group)
overlap1.gif


In another post, @JQL summarized the situation very well:
JQL wrote:
pilou wrote:YEP! Excellent! :thumb:
What make exactly this double click ?


When you create a group and copy it, it is just like any component, and you get duplicate instances of the same definition (duplicate groups behaving like duplicate components).

However, if you double-click it, you edit it, and even if you do nothing on it, it is made into a different definition, therefor "unique".

What happened is that the plugin hide the face of a group behaving as a component and in doing so it hid the face of both components. If you'd flipped it like Dave suggested, you wouldn't see the problem.


However, I am doing something that should be very basic, very wrong. When I double-click one of the boxes it seems to not be becoming unique so I am not sure what I am doing wrong.

Good news is that I do get it to work fine if I slect one of the boxes and then right-click and select make unique, it does work for me. So I guess my real question (based on these posts is why does the box not become unique when I double-click it or am I not understanding the instructions correctly?
0
User avatar
ntxdave 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby Dave R » Fri May 15, 2015 5:54 pm

ntxdave wrote:Good news is that I do get it to work fine if I slect one of the boxes and then right-click and select make unique, it does work for me. So I guess my real question (based on these posts is why does the box not become unique when I double-click it or am I not understanding the instructions correctly?


The answer is in your question. ;)

Your box is a component, not a group. If it were a group, you wouldn't see the Make Unique option in the Context menu. And just opening a component for editing won't make it unique. (That would be counterproductive.)
1
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby ntxdave » Fri May 15, 2015 6:01 pm

Dave R wrote:
ntxdave wrote:Good news is that I do get it to work fine if I slect one of the boxes and then right-click and select make unique, it does work for me. So I guess my real question (based on these posts is why does the box not become unique when I double-click it or am I not understanding the instructions correctly?


The answer is in your question. ;)

Your box is a component, not a group. If it were a group, you wouldn't see the Make Unique option in the Context menu. And just opening a component for editing won't make it unique. (That would be counterproductive.)


See, I told everyone it was a dumb question. I deleted the 2nd box, exploded the first one, and then made it a group. Used the move tool to make the 2nd copy, double-clicked it and you guessed it, it worked.

Thanks Dave for pulling my head out of my posterior. :thumb: :berserk:
0
User avatar
ntxdave 
 

Re: [Plugin] Hide Overlapping Geometry (Updated 20150511)

Postby Dave R » Fri May 15, 2015 6:12 pm

Not a dumb question. Sometimes it's the little things that make all the difference, though.
0
Etaoin Shrdlu


%

(THERE'S NO PLACE LIKE)

G28 X0.0 Y0.0 Z0.0

M30

%
User avatar
Dave R 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: clovis sanches, Gabrielmfs, harisanker and 12 guests

Visit our sponsors: