Skip to content

Add landscape canopy and patch primitives#79

Merged
madawei2699 merged 1 commit into
mainfrom
codex/landscape-canopy-patch
Jun 15, 2026
Merged

Add landscape canopy and patch primitives#79
madawei2699 merged 1 commit into
mainfrom
codex/landscape-canopy-patch

Conversation

@madawei2699

Copy link
Copy Markdown
Contributor

Summary

  • add TreeCanopy for stylized trees with trunk and deterministic canopy layers
  • add OrganicPatch for irregular ponds, moss beds, gravel beds, and flower beds
  • add a landscape sample plus docs and LLM authoring guidance

Part of #73

Tests

  • pnpm --filter @i365dev/craftdag-core test
  • pnpm --filter @i365dev/craftdag-core typecheck
  • pnpm lint

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@madawei2699 madawei2699 merged commit 8625582 into main Jun 15, 2026
1 check passed
@madawei2699 madawei2699 deleted the codex/landscape-canopy-patch branch June 15, 2026 21:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new landscape components, TreeCanopy and OrganicPatch, to the component plan specification. It includes comprehensive documentation, schema definitions, validation rules, expansion logic, and tests for both components, along with a new example study. Feedback on the implementation highlights two issues in packages/core/src/componentPlan.ts: first, outputPart unconditionally returns "fill_0" for OrganicPatch, which can cause errors if the first row is completely trimmed away; second, when includeBorder is enabled, rows with zero trim will not generate border blocks, resulting in gaps in the border.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +2507 to +2508
case "OrganicPatch":
return "fill_0";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If the first row of an OrganicPatch (at z = 0) is completely trimmed away (which can happen when roughness is high relative to the width), fill_0 will be skipped and won't be emitted in the placements. However, outputPart still returns "fill_0" unconditionally. This will cause compilation or graph errors for any other components referencing this OrganicPatch because they will try to connect to a non-existent node ID.\n\nTo prevent this, outputPart should dynamically return the first actually emitted part of the patch, falling back to "fill_0" only if the patch is empty.

    case "OrganicPatch": {\n      const placements = organicPatchPlacements(component);\n      return placements.length > 0 ? placements[0].part : "fill_0";\n    }

Comment on lines +2215 to +2216
for (let z = 0; z < size.length; z += 1) {
const trim = organicRowTrim(z, size.length, roughness);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When includeBorder is enabled, the border blocks are placed in the trimmed space (i.e., at anchor.x + trim - 1 and anchor.x + trim + width). However, if trim is 0 (which occurs on rows where no trimming is applied), no border blocks are generated for that row. This results in visible gaps in the border of the patch (e.g., a pond with missing stone borders on some rows).\n\nTo ensure a continuous and complete border, we should guarantee a minimum trim of 1 block on all rows when includeBorder is true.

  for (let z = 0; z < size.length; z += 1) {\n    const rawTrim = organicRowTrim(z, size.length, roughness);\n    const trim = includeBorder && rawTrim === 0 ? 1 : rawTrim;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant