SpecularColor for Faces (Materials per Face)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
SpecularColor for Faces (Materials per Face)
Hi,
is there a way to add some material properties to Faces instead to the all Shape?
I would like to have for example a Cube with one Face Gold and one other Emerald?
I know it is possible to assign per Face Transparency, so I was thinking of something similar...
That would allow to load i.e. a colored model (union of colored parts) and display it with shininess as for example is possible in CADAssistant
Thx
Maurice
is there a way to add some material properties to Faces instead to the all Shape?
I would like to have for example a Cube with one Face Gold and one other Emerald?
I know it is possible to assign per Face Transparency, so I was thinking of something similar...
That would allow to load i.e. a colored model (union of colored parts) and display it with shininess as for example is possible in CADAssistant
Thx
Maurice
Re: SpecularColor for Faces (Materials per Face)
hi
may be in comboview click right to shape and "Set colors..."
python code:
see here [Résolu] Couleur différentes sur les faces
mario
may be in comboview click right to shape and "Set colors..."
python code:
Code: Select all
Gui.ActiveDocument.Box.DiffuseColor=[(1.,0.,0.),(0.,1.,0.),(0.,0.,1.),(1.,1.,0.),(1.,0.,1.),(0.,1.,1.)]
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: SpecularColor for Faces (Materials per Face)
Hi @mario52mario52 wrote:hi
may be in comboview click right to shape and "Set colors..."
...
mario
thanks for going into this...
unfortunately what you are linking is just Diffuse color per Faces...
what I would need is Materials for Faces...
ATM I think Materials can only be added to all Shape and not to singular Face
Please have a look at the two situations:
1) Cube, Cone, Sphere with Materials added (right click 'Appearance')
2) the same objects fused as one where only Diffuse property is maintained... This is only an aesthetic feature, but, I see that something in going into 'UX/UI Design' and user experience
I just noticed that main CADs just have shininess and Specular effect enabled by default (i.e. Catia, SolidWorks, CADAssistance by OCC) I tried by python code but it seems there ares no other properties than Diffuse for Faces
Maurice
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: SpecularColor for Faces (Materials per Face)
You have to hack the pivy node.
Re: SpecularColor for Faces (Materials per Face)
would you please give me some tips? or a simple example?microelly2 wrote:You have to hack the pivy node.
that would be great!
Maurice
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: SpecularColor for Faces (Materials per Face)
Code: Select all
v=App.ActiveDocument.ActiveObject.ViewObject
v.ShapeMaterial
m=v.ShapeMaterial
m.EmissiveColor=(1.0,0.0,0.0,0.5)
m.SpecularColor=(0.0,1.0,0.0,1.0)
m.EmissiveColor=(0.0,0.0,0.0,0.5)
m.DiffuseColor=(0.0,1.0,0.0,1.0)
m.SpecularColor=(1.0,1.0,0.0,1.0)
m.EmissiveColor=(1.0,0.0,0.0,0.5)
Re: SpecularColor for Faces (Materials per Face)
Hi @microelly2microelly2 wrote:Code: Select all
v=App.ActiveDocument.ActiveObject.ViewObject v.ShapeMaterial m=v.ShapeMaterial m.EmissiveColor=(1.0,0.0,0.0,0.5) m.SpecularColor=(0.0,1.0,0.0,1.0) m.EmissiveColor=(0.0,0.0,0.0,0.5) m.DiffuseColor=(0.0,1.0,0.0,1.0) m.SpecularColor=(1.0,1.0,0.0,1.0) m.EmissiveColor=(1.0,0.0,0.0,0.5)
whith that I can associate a diffuse color and a specular color to an object...
what I would need is to assign diffuse and specular per faces... is that possible?
I mean I would need to create a material to be attached to a face
for example if the face has red diffuse color, I would need to attach an orange specular color; if the face has blue color, I would need to attach a lightblue color
thx again for support
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: SpecularColor for Faces (Materials per Face)
this can be very complex,
the simplest way ist to generate faceholders for your faces and colorate each this way
I did this with transparency here:
freecadbuch.de/doku.php?id=blog:transparenz_-_peel_the_egg
the simplest way ist to generate faceholders for your faces and colorate each this way
I did this with transparency here:
freecadbuch.de/doku.php?id=blog:transparenz_-_peel_the_egg
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: SpecularColor for Faces (Materials per Face)
An other way is to change the inventor node
I have done this with texture images here
https://freecadbuch.de/doku.php?id=blog ... en_bringen
the structure of a per face coloring you find at the end of this link
http://developer90.openinventor.com/con ... ile-format
https://webdocs.cs.ualberta.ca/~graphic ... mentor.pdf
pages 137,282 ff
I have done this with texture images here
https://freecadbuch.de/doku.php?id=blog ... en_bringen
the structure of a per face coloring you find at the end of this link
http://developer90.openinventor.com/con ... ile-format
https://webdocs.cs.ualberta.ca/~graphic ... mentor.pdf
pages 137,282 ff
Re: SpecularColor for Faces (Materials per Face)
Hi @ microelly2microelly2 wrote:this can be very complex,
the simplest way ist to generate faceholders for your faces and colorate each this way
...
the faceholder way is quite complex and will change the model to reach its visualization... so I wouldn't like to consider it...
that seems the right / feasible approach!microelly2 wrote:An other way is to change the inventor node
I have done this with texture images here ...
I will have a look at the docs...
thx
M