Jewelry
Design rings, earrings and pendants from the numbers a jeweller uses — ring
size, carat, alloy — and get back a model you can cast: stones connect into
settings built for them, and every piece reports its metal weight and any
wall or prong that is too thin. This is the cadbuildr-jewelry library, built on
Foundation.
Prerequisites: the cadbuildr-jewelry package from the CADbuildr monorepo
(py/packages/cadbuildr/jewelry); it installs cadbuildr-foundation.
Make a solitaire ring
from cadbuildr.foundation import show
from cadbuildr.jewelry import SolitaireRing, check_manufacturing, jewelry_bom
ring = SolitaireRing(
ring_size="US 6.5", # or "UK M1/2", "EU 53", "JP 12"
cut="oval",
carat=1.5,
setting="6-prong", # "4-prong", "6-prong" or "bezel"
metal="Platinum 950",
engraving="A & B", # cut into the inside of the band
)
assert check_manufacturing(ring) == []
for row in jewelry_bom(ring):
print(row["designation"], row.get("total_g"), row.get("total_ct"))
show(ring)RingShank US 6.5 D-shape 2.4x1.7 mm 4.183 None
ProngHead for 1.50 ct oval diamond (9.15x6.53 mm) 1.111 None
Diamond oval 6.53 mm None 1.5In the Prototype app the ring’s inputs appear in the configuration bar:
change ring_size or carat and the shank, the head and the stone rebuild
together.
Sizes, metals and cuts
| Table | What it holds |
|---|---|
RING_SIZES | US 3-13 (quarters), UK A-Z (halves), EU 44-76, JP 1-30 → inner diameter (mm) |
METALS | 14K / 18K / 22K gold, sterling silver, Pt950, Pd950, brass: density, casting shrinkage, minimum wall / shank / prong |
CUTS | round, princess, cushion, oval, emerald, asscher, radiant, pear, marquise: standard proportions and the carat formula |
GEMS | diamond, moissanite, sapphire, ruby, emerald, … by specific gravity |
from cadbuildr.jewelry import inner_diameter, size_label, stone_dims
inner_diameter("US 7") # 17.32
size_label("US 7", "EU") # "EU 54"
stone_dims("round", 1.0).width # 6.45 mm
stone_dims("round", width=1.3) # a melee stone, carat computedAn unknown size, metal or cut raises an error that names the closest match.
Build your own piece
Parts connect through interfaces — there are no positions to type. The
setting is built from the same cut and carat as the stone, so its seat
fits:
from cadbuildr.foundation import Assembly, show
from cadbuildr.jewelry import ProngHead, RingShank, Stone
ring = Assembly()
shank = RingShank(ring_size="UK M", width=2.2, metal="Platinum 950")
ring.ground(shank)
head = ProngHead(cut="oval", carat=1.5, prongs=6, metal="Platinum 950")
ring.connect(head.interface("base"), shank.interface("top"))
stone = Stone(cut="oval", carat=1.5)
ring.connect(stone.interface("girdle"), head.interface("seat"))
show(ring)A stone of another size is refused:
IncompatibleInterfaces: ... stone width 7.22 mm does not fit the 6.45 mm seat
(build the setting from the same cut and carat as the stone)| Part | Connects with |
|---|---|
Stone | girdle → a setting’s seat |
ProngHead, BezelSetting, HaloHead | base → a shank’s top or an earring post’s pad; seat ← the stone |
HaloHead | halo_0 .. halo_n ← the melee stones |
WeddingBand, RingShank | bottom ← a casting Sprue |
EarringPost / EarringBack | the back slides on the post |
BezelSetting(bail_lug=True) / Bail | bail ← the bail’s peg |
ChainLink | end ← the next link’s start |
For a halo, connect one melee stone and replicate it onto the other seats:
from cadbuildr.foundation import Assembly
from cadbuildr.jewelry import HaloHead, RingShank, Stone
ring = Assembly()
shank = RingShank(ring_size="US 6")
ring.ground(shank)
halo = HaloHead(cut="cushion", carat=1.5, melee_size=1.3)
ring.connect(halo.interface("base"), shank.interface("top"))
centre = Stone(cut="cushion", carat=1.5)
ring.connect(centre.interface("girdle"), halo.interface("seat"))
seats = halo.halo_seats()
melee = Stone(cut="round", width=1.3)
ring.connect(melee.interface("girdle"), seats[0])
ring.replicate(melee, onto=[s.anchor for s in seats])HaloRing is this piece ready-made. StudEarring, Pendant and Chain
are the other finished pieces.
Casting checks
| Check | Where |
|---|---|
| Band, prong, bezel wall and gallery thinner than the alloy minimum | check_manufacturing(piece) (strict=True raises) |
| Head foot wider than the shank can carry | connect refuses it |
| Sprue thinner than 0.8 x the section it feeds | connect refuses it |
| Wax / print model scaled for shrinkage | RingShank(..., cast_allowance=True) |
| Metal weight per alloy | metal_weight(piece) |
from cadbuildr.jewelry import RingShank, check_manufacturing
check_manufacturing(RingShank(thickness=1.0, metal="Sterling silver 925"))
# [{'check': 'min_shank', 'message': 'band thickness 1.00 mm < 1.40 mm minimum for Sterling silver 925', ...}]The minimums and shrinkage values are workshop defaults; check them with your caster.