Assign material to brepfaces

Hi,

I’m attempting to assign materials directly to brepFaces. I can’t find any methods that fit, and feel like I’ve looked everywhere: the object, the face, and everything in between. Is it simply not possible without exploding it into a polymesh, and assigning on a per-object basis?

Best,
Aske

Hi @aske,

There is certainly a way of doing this in C++:

cmdSamplePerFaceMaterial.cpp

Thus far, I haven’t found a way of doing this in RhinoCommon. @nathanletwory is this something you know about?

– Dale

1 Like

Thanks for the reply!

As far as I can read the C++ sample, you add a channel to the material, then select that channel on the brepFace. In C# there is nothing called anything with material or channel on brepfaces that I can see. I also can’t see channels being present on materials but maybe I’m looking in the wrong place.

Hi @aske,

I’ve logged this issue. Hopefully we can get something added.

https://mcneel.myjetbrains.com/youtrack/issue/RH-57389

– Dale

2 Likes

Hey @Jussi_Aaltonen

Can I hope for this to be looked at, or is it not a priority so I should explore alternatives?

Best,
Aske

Hi @aske, there aren’t any alternatives that I can think of. So we’ll try to get it done.

1 Like

Thanks for the update! I won’t start messing with PInvoke then :slight_smile:

RH-57389 is fixed in the latest Service Release Candidate

1 Like

Hi @aske, I’ve added sample code for setting brep face materials:

1 Like

Thanks Jussi! These kind of examples are super valuable so us users don’t have to go asking on the forums all the time! Keep it up! :tada:

1 Like