diff --git a/tools/editor/cli_arg_required.cpp b/tools/editor/cli_arg_required.cpp index f30cb4f2..77506e97 100644 --- a/tools/editor/cli_arg_required.cpp +++ b/tools/editor/cli_arg_required.cpp @@ -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", diff --git a/tools/editor/cli_gen_mesh.cpp b/tools/editor/cli_gen_mesh.cpp index dc4e01e8..8d7c8410 100644 --- a/tools/editor/cli_gen_mesh.cpp +++ b/tools/editor/cli_gen_mesh.cpp @@ -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}, diff --git a/tools/editor/cli_help.cpp b/tools/editor/cli_help.cpp index 2955a447..d69c91a5 100644 --- a/tools/editor/cli_help.cpp +++ b/tools/editor/cli_help.cpp @@ -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 [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 [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 \n"); std::printf(" Convenience: emit tent + firepit + bedroll + canopy + woodpile + haystack into outDir as 6 .wom files\n"); std::printf(" --gen-blacksmith-pack \n");