Page 1 of 1

Set face color

Posted: Tue Aug 27, 2024 2:11 am
by Mellow Tim
Hi,

I have a solid imported via step. Is there a way to change color of a face? I know a way for doing this for the whole solid via IMaterial_DG. How do I get material for a face?

Thank you for your insights!

Re: Set face color

Posted: Wed Aug 28, 2024 1:35 am
by Dave Thomas
This was added in v7.0, I think.

You need to query IBRepShape_DG out of IBRepFace_DG. and use the IBRepShape_DG.GetAppearance, which is actually an IMaterial_DG. (query/cast).

It is in the Shape Explorer sample: Click 'More Face Properties' at the bottom. In the popped-up dialogue there is Per Face Color button.