Skip to content

Commit

Permalink
Extract common 3D colors into cadquery_helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ubruhin committed Sep 15, 2023
1 parent 23175f7 commit f28a2d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cadquery_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
from OCP.Message import Message, Message_Gravity # type: ignore


class StepColor:
LEAD_SMT = cq.Color('gainsboro')


class StepAssembly:
"""
A STEP assembly.
Expand Down
6 changes: 3 additions & 3 deletions generate_chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def generate_3d(
) -> None:
import cadquery as cq

from cadquery_helpers import StepAssembly
from cadquery_helpers import StepAssembly, StepColor

print(f'Generating pkg 3D model "{full_name}": {uuid_3d}')

Expand Down Expand Up @@ -675,8 +675,8 @@ def generate_3d(

assembly = StepAssembly(full_name)
assembly.add_body(inner, 'inner', inner_color)
assembly.add_body(left, 'left', cq.Color("gainsboro"))
assembly.add_body(right, 'right', cq.Color("gainsboro"))
assembly.add_body(left, 'left', StepColor.LEAD_SMT)
assembly.add_body(right, 'right', StepColor.LEAD_SMT)

out_path = path.join('out', library, 'pkg', uuid_pkg, f'{uuid_3d}.step')
assembly.save(out_path)
Expand Down

0 comments on commit f28a2d6

Please sign in to comment.