Skip to content

How to set a color or label on an shape face? #813

Answered by jdegenstein
njourdane asked this question in Q&A
Discussion options

You must be logged in to vote

As you might have surmised, build123d does not support having more than one color per object. I also regularly need functionality to "highlight" specific faces/edges/vertices but I approach it in a far less manual way using some of the features of OCP CAD Viewer. I have found that if the manual approach is too tedious then I simply avoid using it which negatively impacts my overall modeling productivity.

from build123d import *
from ocp_vscode import *
set_port(3939)
show_clear()
set_defaults(ortho=True, default_edgecolor="#121212")

with BuildPart() as p:
    Box(1,2,.5)
    Box(.5,1,.5,mode=Mode.SUBTRACT)
    someface = faces().sort_by(Axis.X)[-1]

set_colormap(ColorMap.seeded(colormap="…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by njourdane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants