metafizzy / metafizzy/zdog

backface for Group

Open
#4 0 comments 5 reactions 0 assignees View on GitHub
feature request
Dominant language
JavaScript
Stars
10.7k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

Currently, let's say your model is a wall: a `Group` with 5 `Rect`s, 1 for the wall and 4 for windows. Currently if you want to use `backface` for this wall, you have to set it for all 5 `Rect`s.

``` js
let wallGroup = new Group(...);
// wall
new Rect({
addTo: wallGroup,
backface: false,
// ...
});

let wallWindow = new Rect({
addTo: wallGroup,
backface: false,
// ...
});
wallWindow.copy(...);
wallWindow.copy(...);
wallWindow.copy(...);
```

Instead, `Group` should have `backface` that sets visibility for all of its descendant graph.

``` js
let wallGroup = new Group({
backface: false,
// ...
});
// wall
new Rect({
addTo: wallGroup,
// ...
});

let wallWindow = new Rect({
addTo: wallGroup,
// ...
});
wallWindow.copy(...);
wallWindow.copy(...);
wallWindow.copy(...);
```

---

**Add a 👍 reaction** to this issue if you would like to see this feature added. Do not add +1 comments — [They will be deleted](https://metafizzy.co/blog/use-github-reactions-delete-plus-1-comments/).

Contributor guide

Open the contributing guide

Research direction

Start by reading the Group and Rect entry points and tracing how backface visibility is applied to descendants. Check the descendant graph behavior described in the issue and determine how Group-level backface should affect nested Rects and copies. Done means setting backface on a Group controls all descendant shapes without repeating the option on each Rect.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.