From 22cd2eac6bfc7eefa697faac75eb3a6aea563c88 Mon Sep 17 00:00:00 2001 From: anshk Date: Mon, 30 Mar 2026 20:21:29 +0530 Subject: [PATCH] docs: added Task notes for task3 --- Week-1/Task-3/TaskNotes.md | 137 +++++++++++++++++++++++++++---------- 1 file changed, 99 insertions(+), 38 deletions(-) diff --git a/Week-1/Task-3/TaskNotes.md b/Week-1/Task-3/TaskNotes.md index e8be752..bf42a89 100644 --- a/Week-1/Task-3/TaskNotes.md +++ b/Week-1/Task-3/TaskNotes.md @@ -1,60 +1,121 @@ -# Task: [Feature Name] +# Task: Duplicate Object / Duplicate Group ## Objective -What is the feature trying to do? +Duplicate an object and, if possible, duplicate a grouped structure. + +## Test File Split +- Vanilla object duplication test: `main.js` +- Vanilla group duplication test: `group.js` +- R3F object duplication test: `src/App.jsx` +- R3F group duplication test: `src/Group.jsx` +- Run object test: default route +- Command (Vanilla object): `npm run dev:object` or `yarn dev:object` +- Command (Vanilla group): `npm run dev:group` or `yarn dev:group` ## Vanilla three.js --Possible: Yes / Partial / No --Notes: --Key concepts: --Complexity: Easy / Medium / Hard +- Possible: Yes +- Notes: +- Object duplication is in `main.js` using mesh clone. +- Group duplication is in `group.js` using `THREE.Group()` and group clone. +- Transforms preserved: Yes, duplicate keeps copied transform values and can be moved independently after duplication. +- Structure preserved: Yes, child hierarchy is preserved when duplicating a group. +- Linked or independent: Mostly independent transforms, but geometry and material are shared by default unless explicitly cloned. +- UX clean: Yes for developers, but requires code understanding. +- Key concepts: +- Object3D clone behavior +- Shared vs cloned geometry and material +- Complexity: Easy ## R3F --Possible: Yes / Partial / No --Notes: --What R3F abstracted: --Complexity: Easy / Medium / Hard +- Possible: Yes +- Notes: +- Object duplication is in `src/App.jsx` using repeated meshes with shared geometry/material. +- Group duplication is in `src/Group.jsx` by rendering the grouped component twice. +- Transforms preserved: Yes, each instance has its own position, rotation, and scale. +- Structure preserved: Yes, component tree/group structure is preserved. +- Linked or independent: Instance transforms are independent; geometry/material may be shared or isolated depending on how props/instances are created. +- UX clean: Yes, declarative and easier to scale. +- What R3F abstracted: +- Imperative clone calls become declarative repeated components/instances. +- Complexity: Easy ## Thob Page Builder --Possible: Yes / Partial / No --Notes: --Builder steps: --Complexity: Easy / Medium / Hard +- Possible: Yes +- Notes: +- There is a shortcut to duplicate objects. +- Observed behavior: duplicate creates a completely different object that cannot be linked to the original, unlike vanilla and R3F patterns where sharing/linking behavior can be controlled. +- Duplicate group behavior: Same as single object duplication, a complete copy is made with no linking. +- Transforms preserved: Yes. +- Structure preserved: Yes, as copy- paste duplication. +- Linked or independent: Independent only, with no linking behavior available. +- UX clean: Mixed. Shortcut is quick, but behavior is confusing because linked duplication is not possible. +- Builder steps: +- Create an object +- Use duplicate shortcut +- Duplicate a grouped structure and verify it is a full independent copy +- Complexity: Medium + +## What to Observe +- Are transforms preserved? +- Vanilla: Yes +- R3F: Yes +- Thob: Yes +- Does duplication preserve structure? +- Vanilla: Yes +- R3F: Yes +- Thob: Yes, as full copy- paste duplication +- Does the duplicate remain linked or independent? +- Vanilla: Transform- independent, data can be shared by default unless cloned +- R3F: Transform- independent, sharing depends on implementation +- Thob: Independent only, no linking behavior +- Is the UX clean? +- Vanilla: Technical but predictable +- R3F: Clean and scalable +- Thob: Fast shortcut, but ambiguous result for duplication semantics ## Comparison Summary --Possible in all 3? Yes / Partial / No --Main differences: --Where Thob is better: --Where Thob is weaker: --What feels awkward or unclear: +- Possible in all 3? Yes +- Main differences: +- Vanilla and R3F give clear control over sharing vs independence. +- Thob duplicate shortcut creates separate objects and does not support linked behavior. +- Where Thob is better: +- Fast editor action for simple duplication +- Where Thob is weaker: +- No linked duplication model +- No linked group duplication model +- What feels awkward or unclear: +- No option to keep duplicates linked for synchronized edits ## Limitation Type (if any) --[ ] Editor UX limitation --[ ] Runtime limitation --[ ] Schema / data model limitation --[ ] Component limitation --[ ] Event system limitation --[ ] Asset pipeline limitation --[ ] Unknown / needs investigation +- [x] Editor UX limitation +- [ ] Runtime limitation +- [x] Schema / data model limitation +- [ ] Component limitation +- [ ] Event system limitation +- [ ] Asset pipeline limitation +- [ ] Unknown / needs investigation ## Workaround --Is there a workaround? --If yes, what is it? +- Is there a workaround? +- Yes +- If yes, what is it? +- Use reusable components/prefabs and instantiate multiple independent copies. +- If linked behavior is required, use explicit shared data/component references where supported. ## Suggested Improvement --What should improve in Thob? --Is it: - -editor - -runtime - -component - -UX - -schema/data +- What should improve in Thob? +- Add explicit duplicate modes: independent duplicate and linked duplicate. +- Add reliable deep group duplication with clear hierarchy preview. +- it Is: +- editor +- schema/data +- UX ## Difficulty Estimate --Easy / Medium / Hard +- Medium ## Business Value --Low / Medium / High +- High ## Recommendation -Should Thob support this better? Why? \ No newline at end of file +Yes. Thob should support both independent and linked duplication because currently duplication works as copy-paste only, which limits synchronized workflows. \ No newline at end of file