feat(editor): add --gen-mesh-urn 4-tier pottery vessel

79th procedural mesh primitive. Vertical urn built from 4
stacked tiers using the new addClosedCylinderY helper:

  • foot — wide short cylinder (the ground-meeting base)
  • body — tall main cylinder (the storage volume)
  • neck — narrow constriction
  • lip — slightly wider rim cap

Each tier is an independent watertight Y-axis cylinder with
its own ±Y end caps; they're stacked vertically with each
sitting on the previous tier's top.

Useful for temple offerings, mausoleum interiors, kitchen
storage, alchemist labs, funerary scenes, witch-hut detail.
First handler to consume the new addClosedCylinderY helper —
demonstrates the pattern for future cylindrical primitives
(candle, lantern, scroll case, well-pail, etc.).

Watertight under weld (verified 432 manifold edges, 0
boundary, 0 non-manifold).
This commit is contained in:
Kelsi 2026-05-09 13:27:06 -07:00
parent 7d308e6044
commit 60470eaa35
3 changed files with 63 additions and 1 deletions

View file

@ -60,7 +60,7 @@ const char* const kArgRequired[] = {
"--gen-mesh-stone-bench", "--gen-mesh-mine-cart",
"--gen-mesh-hitching-rail", "--gen-mesh-pillar-row",
"--gen-mesh-statue-base", "--gen-mesh-bird-bath",
"--gen-mesh-planter-box",
"--gen-mesh-planter-box", "--gen-mesh-urn",
"--gen-camp-pack", "--gen-blacksmith-pack", "--gen-village-pack",
"--gen-temple-pack", "--gen-graveyard-pack",
"--gen-garden-pack", "--gen-dock-pack", "--gen-tavern-pack",

View file

@ -5161,6 +5161,65 @@ int handleTent(int& i, int argc, char** argv) {
return 0;
}
int handleUrn(int& i, int argc, char** argv) {
// Multi-tier vertical urn: foot (wide short cylinder) →
// body (tall main cylinder) → neck (narrow constriction) →
// lip (slightly wider rim). All four tiers use the shared
// addClosedCylinderY helper, so the urn is a stack of four
// independent watertight tubes. Useful for temple offerings,
// mausoleum interiors, kitchen storage, alchemist labs,
// funerary scenes. The 79th procedural mesh primitive.
std::string womBase = argv[++i];
float bodyR = 0.18f;
float bodyH = 0.40f;
float footR = 0.22f;
float footH = 0.06f;
float neckR = 0.12f;
float neckH = 0.10f;
float lipR = 0.16f;
float lipH = 0.04f;
int sides = 18;
parseOptFloat(i, argc, argv, bodyR);
parseOptFloat(i, argc, argv, bodyH);
parseOptFloat(i, argc, argv, footR);
parseOptFloat(i, argc, argv, footH);
parseOptFloat(i, argc, argv, neckR);
parseOptFloat(i, argc, argv, neckH);
parseOptFloat(i, argc, argv, lipR);
parseOptFloat(i, argc, argv, lipH);
parseOptInt(i, argc, argv, sides);
if (bodyR <= 0 || bodyH <= 0 || footR <= 0 || footH <= 0 ||
neckR <= 0 || neckH <= 0 || lipR <= 0 || lipH <= 0 ||
sides < 6 || sides > 64) {
std::fprintf(stderr,
"gen-mesh-urn: dims > 0; sides 6..64\n");
return 1;
}
stripExt(womBase, ".wom");
wowee::pipeline::WoweeModel wom;
initWomDefaults(wom, womBase);
// Stack 4 tiers from ground up.
float y = 0.0f;
addClosedCylinderY(wom, footR, y, y + footH, sides);
y += footH;
addClosedCylinderY(wom, bodyR, y, y + bodyH, sides);
y += bodyH;
addClosedCylinderY(wom, neckR, y, y + neckH, sides);
y += neckH;
addClosedCylinderY(wom, lipR, y, y + lipH, sides);
y += lipH;
finalizeAsSingleBatch(wom);
float maxR = std::max({footR, bodyR, lipR});
setCenteredBoundsXZ(wom, maxR, maxR, y);
if (!saveWomOrError(wom, womBase, "gen-mesh-urn")) return 1;
printWomWrote(womBase);
std::printf(" tiers : foot R=%.3f, body R=%.3f, neck R=%.3f, "
"lip R=%.3f\n", footR, bodyR, neckR, lipR);
std::printf(" total H : %.3f (%d sides)\n", y, sides);
printWomMeshStats(wom);
return 0;
}
int handlePlanterBox(int& i, int argc, char** argv) {
// Window-sill / garden planter box: long open-top wooden
// basin (5-piece bottom + 4 walls construction) plus a
@ -7265,6 +7324,7 @@ constexpr MeshEntry kMeshTable[] = {
{"--gen-mesh-statue-base", 1, handleStatueBase},
{"--gen-mesh-bird-bath", 1, handleBirdBath},
{"--gen-mesh-planter-box", 1, handlePlanterBox},
{"--gen-mesh-urn", 1, handleUrn},
{"--gen-camp-pack", 1, handleGenCampPack},
{"--gen-blacksmith-pack", 1, handleGenBlacksmithPack},
{"--gen-village-pack", 1, handleGenVillagePack},

View file

@ -304,6 +304,8 @@ void printUsage(const char* argv0) {
std::printf(" Bird bath: thin cylindrical stem topped by a wide shallow basin disc (small garden water feature)\n");
std::printf(" --gen-mesh-planter-box <wom-base> [length] [width] [height] [wallT] [soilTopFrac]\n");
std::printf(" Planter box: long open-top wood basin + visible soil-fill block (window sills / kitchen / balcony)\n");
std::printf(" --gen-mesh-urn <wom-base> [bodyR] [bodyH] [footR] [footH] [neckR] [neckH] [lipR] [lipH] [sides]\n");
std::printf(" Urn: 4-tier vertical pottery vessel (foot + body + neck + lip) — temple / mausoleum / kitchen storage\n");
std::printf(" --gen-camp-pack <outDir>\n");
std::printf(" Convenience: emit tent + firepit + bedroll + canopy + woodpile + haystack into outDir as 6 .wom files\n");
std::printf(" --gen-blacksmith-pack <outDir>\n");