Set face color

Everything DG Kernel: Technical discussions and issues
Post Reply
Mellow Tim
Posts: 1
Joined: Tue Aug 27, 2024 2:06 am

Set face color

Post 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!
Dave Thomas
Posts: 1
Joined: Wed Aug 28, 2024 1:27 am

Re: Set face color

Post 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.
Post Reply