mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
feat(editor): add --gen-mesh-chalice ceremonial goblet
82nd procedural mesh primitive. 3-tier ceremonial chalice:
• foot — wide flat base disc (the goblet's footprint on
the table)
• stem — thin tall connecting column (the holding-grip)
• bowl — wider shallow cup at the top
Validates that stemR < both footR and bowlR so the
silhouette always reads as the classic wide-narrow-wide
goblet shape rather than a degenerate cylinder stack.
Three more primitives that consume the addClosedCylinderY
helper this batch (lantern + chalice from the previous
two commits + this), pattern is now well-established.
Useful for chapel altars, treasure rooms, royal-court
banquet tables, ritual / cult scenes, dwarven mead halls,
fairy-tale storybook props. Watertight under weld
(verified 252 manifold edges, 0 boundary, 0 non-manifold).
Milestone: kArgRequired now reaches 420 documented flags.
This commit is contained in:
parent
c9892f29d0
commit
8a73324a5a
3 changed files with 55 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ const char* const kArgRequired[] = {
|
|||
"--gen-mesh-hitching-rail", "--gen-mesh-pillar-row",
|
||||
"--gen-mesh-statue-base", "--gen-mesh-bird-bath",
|
||||
"--gen-mesh-planter-box", "--gen-mesh-urn", "--gen-mesh-candle",
|
||||
"--gen-mesh-lantern",
|
||||
"--gen-mesh-lantern", "--gen-mesh-chalice",
|
||||
"--gen-camp-pack", "--gen-blacksmith-pack", "--gen-village-pack",
|
||||
"--gen-temple-pack", "--gen-graveyard-pack",
|
||||
"--gen-garden-pack", "--gen-dock-pack", "--gen-tavern-pack",
|
||||
|
|
|
|||
|
|
@ -5161,6 +5161,57 @@ int handleTent(int& i, int argc, char** argv) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int handleChalice(int& i, int argc, char** argv) {
|
||||
// Ceremonial chalice / goblet: foot (wide flat base) →
|
||||
// stem (thin tall connecting column) → bowl (wider shallow
|
||||
// cup). 3-tier vertical-cylinder shape with the classic
|
||||
// wide-narrow-wide silhouette of a wine goblet. The 82nd
|
||||
// procedural mesh primitive.
|
||||
std::string womBase = argv[++i];
|
||||
float footR = 0.10f;
|
||||
float footH = 0.02f;
|
||||
float stemR = 0.025f;
|
||||
float stemH = 0.16f;
|
||||
float bowlR = 0.09f;
|
||||
float bowlH = 0.10f;
|
||||
int sides = 14;
|
||||
parseOptFloat(i, argc, argv, footR);
|
||||
parseOptFloat(i, argc, argv, footH);
|
||||
parseOptFloat(i, argc, argv, stemR);
|
||||
parseOptFloat(i, argc, argv, stemH);
|
||||
parseOptFloat(i, argc, argv, bowlR);
|
||||
parseOptFloat(i, argc, argv, bowlH);
|
||||
parseOptInt(i, argc, argv, sides);
|
||||
if (footR <= 0 || footH <= 0 || stemR <= 0 || stemH <= 0 ||
|
||||
bowlR <= 0 || bowlH <= 0 || sides < 6 || sides > 64 ||
|
||||
stemR >= footR || stemR >= bowlR) {
|
||||
std::fprintf(stderr,
|
||||
"gen-mesh-chalice: dims > 0; sides 6..64; "
|
||||
"stemR < footR; stemR < bowlR\n");
|
||||
return 1;
|
||||
}
|
||||
stripExt(womBase, ".wom");
|
||||
wowee::pipeline::WoweeModel wom;
|
||||
initWomDefaults(wom, womBase);
|
||||
float y = 0.0f;
|
||||
addClosedCylinderY(wom, footR, y, y + footH, sides);
|
||||
y += footH;
|
||||
addClosedCylinderY(wom, stemR, y, y + stemH, sides);
|
||||
y += stemH;
|
||||
addClosedCylinderY(wom, bowlR, y, y + bowlH, sides);
|
||||
y += bowlH;
|
||||
finalizeAsSingleBatch(wom);
|
||||
float maxR = std::max({footR, stemR, bowlR});
|
||||
setCenteredBoundsXZ(wom, maxR, maxR, y);
|
||||
if (!saveWomOrError(wom, womBase, "gen-mesh-chalice")) return 1;
|
||||
printWomWrote(womBase);
|
||||
std::printf(" foot/stem/bowl : R=%.3f / %.3f / %.3f\n",
|
||||
footR, stemR, bowlR);
|
||||
std::printf(" total H : %.3f (%d sides)\n", y, sides);
|
||||
printWomMeshStats(wom);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handleLantern(int& i, int argc, char** argv) {
|
||||
// Hand lantern: small base disc → wider glass-globe cylinder
|
||||
// → narrow neck → wider top cap. 4 cylindrical tiers stacked,
|
||||
|
|
@ -7281,6 +7332,7 @@ constexpr MeshEntry kMeshTable[] = {
|
|||
{"--gen-mesh-urn", 1, handleUrn},
|
||||
{"--gen-mesh-candle", 1, handleCandle},
|
||||
{"--gen-mesh-lantern", 1, handleLantern},
|
||||
{"--gen-mesh-chalice", 1, handleChalice},
|
||||
{"--gen-camp-pack", 1, handleGenCampPack},
|
||||
{"--gen-blacksmith-pack", 1, handleGenBlacksmithPack},
|
||||
{"--gen-village-pack", 1, handleGenVillagePack},
|
||||
|
|
|
|||
|
|
@ -316,6 +316,8 @@ void printUsage(const char* argv0) {
|
|||
std::printf(" Candle: thin wax pillar on optional saucer base (set saucerR=0 to skip) — chapels / vigil scenes\n");
|
||||
std::printf(" --gen-mesh-lantern <wom-base> [baseR] [baseH] [globeR] [globeH] [neckR] [neckH] [capR] [capH] [sides]\n");
|
||||
std::printf(" Lantern: 4-tier base + glass-globe + neck + cap stack (hand lantern / oil lamp silhouette)\n");
|
||||
std::printf(" --gen-mesh-chalice <wom-base> [footR] [footH] [stemR] [stemH] [bowlR] [bowlH] [sides]\n");
|
||||
std::printf(" Chalice: ceremonial 3-tier foot + stem + bowl goblet (chapel / treasure / ritual scene)\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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue