Two identical faces, but show just one
-
Hi!
I have the following problem: I have two identical (in the view of position) faces. One is green, the other one grey. Sketchup shows these two faces now with a little bit grey and a little bit green, and it changes by rotating the view.
Is there a possibility to push one of these two faces to a higher "level"? Means, it is possible to show just the green one?
To be honest, I don't know the right englisch words descriping this situation, to do a serious search in google and in your forum respectively...
Thanks a lot for your help!
-
The effect is called z-fighting. You can not give them a different priority to avoid this. You can
- move them to different positions (a little bit)
- hide one of them
- ...
-
@cotty said:
The effect is called z-fighting. You can not give them a different priority to avoid this. You can
- move them to different positions (a little bit)
- hide one of them
- ...
Ahh okay, thanks a lot for your help! I will try to hide the affected faces....
-
You can always make the face into a component and glue the component onto the other face. They will not "Z-fight" then.
-
Hey Joel! Thanks for your help! What exactly do you mean by
@jolran said:and glue the component onto the other face
? -
@niccah said:
Hey Joel! Thanks for your help! What exactly do you mean by
@jolran said:and glue the component onto the other face
?http://support.google.com/sketchup/bin/answer.py?hl=en&answer=114523
http://support.google.com/sketchup/bin/answer.py?hl=en&answer=114533
http://www.youtube.com/watch?v=LsyC-Sd8LJM
http://www.sketchup.com/intl/en/developer/docs/ourdoc/componentinstance#glued_to=Sorry for just a set of links, but, I should be wrapping up presents instead of surfing the interwaves.
-
Oh thanks a lot! I think, with the help of your links, I will be able so solve the problem!
-
Thomthom's links tells you how it works. Sometimes the API can be hard to understand. Also we don't know where exact you are in your code.
But you can group the face and then turn the group into an component.
I think its easier to work with groups at first and then at some point turn it into an instance-component when ready to glue to a face. Just a personal preference.
Dont know how you want to group your face but be careful not to group Sketchup entities directly(add_group(entities). It can BUGsplat.
And then use the behavior to glue. Lets say you have made your component and it's called inst.You get the behavior with: be = inst.defintion.behavior
You have all the behavior methods in the API. But for gluing you will need to add:
be.is2d = true
be.cuts_opening = true
be.snapto = 0So lets say your second face you want to glue onto is called face2.
Then you just add inst.glued_to = face2
Don't have time to give you more code just now. Maybe Thomthom get back to you after he have packed all his presents
-
Alternatively, if the faces both have transparent materials it will avoid the Z-fighting.
But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling.
-
At first at all, thank you very much for all your help! I will try it at weekend.
@thomthom said:
But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling.
Following situation in my plugin:
- you have a model
- you choose a part of this model, which you like to get milled (for example a pocket)
- after you have choosen it and add it to the "milling list", my plugin will copy this choosen faces into a hidden group
- when you click on the list, the "to be milled" faces (I collored it green) will be shown
- with the help of the hidden faces, the plugin is independent of the real model => so, before calculating the GCode, the user is allowed to change the model itself
I hoped, I could explained my situation understandably
Advertisement