@litfamily/litgravity 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +17 -3
  3. package/README_ko-KR.md +17 -3
  4. package/package.json +1 -1
  5. package/plugin/hooks/lib/lanes.mjs +65 -0
  6. package/plugin/hooks/lib/motion.mjs +34 -5
  7. package/plugin/hooks/lib/reentry.mjs +7 -0
  8. package/plugin/hooks/lib/rewind/brief.mjs +332 -0
  9. package/plugin/hooks/lib/rewind/collect.mjs +328 -0
  10. package/plugin/hooks/lib/rewind/gauge.mjs +55 -0
  11. package/plugin/hooks/lib/rewind/next-step.mjs +77 -0
  12. package/plugin/hooks/lib/rewind/redact.mjs +60 -0
  13. package/plugin/hooks/lib/rewind/transcripts.mjs +211 -0
  14. package/plugin/hooks/lib/routes.mjs +79 -5
  15. package/plugin/hooks/lib/workflow-stack.mjs +213 -0
  16. package/plugin/hooks/post-tool-use.mjs +37 -1
  17. package/plugin/hooks/pre-invocation.mjs +91 -2
  18. package/plugin/hooks/session-start.mjs +26 -3
  19. package/plugin/hooks/stop.mjs +22 -2
  20. package/plugin/hud/looks.mjs +29 -0
  21. package/plugin/hud/render.mjs +234 -12
  22. package/plugin/plugin.json +1 -1
  23. package/plugin/skills/frontend-ui-ux/SKILL.md +12 -1
  24. package/plugin/skills/frontend-ui-ux/kit/components.css +417 -0
  25. package/plugin/skills/frontend-ui-ux/kit/fonts.json +22 -0
  26. package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
  27. package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
  28. package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
  29. package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
  30. package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
  31. package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
  32. package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
  33. package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
  34. package/plugin/skills/frontend-ui-ux/kit/ui.js +226 -0
  35. package/plugin/skills/frontend-ui-ux/references/house-styles.md +234 -0
  36. package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
  37. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +196 -0
  38. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +30 -9
  39. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +20 -8
  40. package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +42 -9
  41. package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
  42. package/plugin/skills/lit-adhd/SKILL.md +157 -0
  43. package/plugin/skills/lit-adhd/references/card-examples.md +101 -0
  44. package/plugin/skills/lit-adhd/references/status-taxonomy.md +32 -0
  45. package/plugin/skills/lit-adhd/scripts/rewind.mjs +5 -0
  46. package/plugin/skills/lit-diagram-drawer/SKILL.md +5 -3
  47. package/plugin/skills/lit-diagram-drawer/references/drawing-rules.md +1 -1
  48. package/plugin/skills/lit-diagram-drawer/references/style-guide.md +21 -12
  49. package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
  50. package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
  51. package/plugin/skills/lit-diagram-drawer/references/type-tree.md +3 -3
  52. package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
  53. package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
  54. package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
  55. package/plugin/skills/lit-docx/SKILL.md +3 -3
  56. package/plugin/skills/lit-handoff/SKILL.md +1 -0
  57. package/plugin/skills/lit-hijack/SKILL.md +263 -0
  58. package/plugin/skills/lit-hijack/references/capture-and-provenance.md +100 -0
  59. package/plugin/skills/lit-hijack/references/clean-room-build.md +75 -0
  60. package/plugin/skills/lit-hijack/references/distil-and-licence.md +67 -0
  61. package/plugin/skills/lit-hijack/references/gap-and-port-design.md +100 -0
  62. package/plugin/skills/lit-hijack/references/parity-and-report.md +85 -0
  63. package/plugin/skills/lit-hijack/scripts/hijack.mjs +953 -0
  64. package/plugin/skills/lit-plan/SKILL.md +1 -1
  65. package/plugin/skills/lit-pptx/SKILL.md +8 -8
  66. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
  67. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
  68. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
  69. package/plugin/skills/lit-pptx/fonts/provenance.json +32 -1
  70. package/plugin/skills/lit-pptx/references/agents/analyst.md +34 -56
  71. package/plugin/skills/lit-pptx/references/agents/antithesis.md +49 -67
  72. package/plugin/skills/lit-pptx/references/agents/architect.md +38 -51
  73. package/plugin/skills/lit-pptx/references/agents/critic.md +25 -41
  74. package/plugin/skills/lit-pptx/references/agents/synthesizer.md +37 -46
  75. package/plugin/skills/lit-pptx/references/agents/thesis.md +29 -49
  76. package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +119 -145
  77. package/plugin/skills/lit-pptx/references/authoring-guide.md +187 -278
  78. package/plugin/skills/lit-pptx/references/consensus-protocol.md +99 -97
  79. package/plugin/skills/lit-pptx/references/data-display-cookbook.md +36 -137
  80. package/plugin/skills/lit-pptx/references/density-and-fill.md +147 -216
  81. package/plugin/skills/lit-pptx/references/design-system-azure.md +56 -85
  82. package/plugin/skills/lit-pptx/references/direction-step.md +134 -176
  83. package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +114 -115
  84. package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +66 -66
  85. package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +63 -63
  86. package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +96 -96
  87. package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +81 -81
  88. package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +103 -103
  89. package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +100 -98
  90. package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +76 -76
  91. package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +96 -96
  92. package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +80 -80
  93. package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +72 -72
  94. package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +95 -95
  95. package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +173 -0
  96. package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +154 -0
  97. package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +139 -0
  98. package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +158 -0
  99. package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +179 -0
  100. package/plugin/skills/lit-pptx/references/interview-protocol.md +83 -102
  101. package/plugin/skills/lit-pptx/references/layout-families.md +161 -265
  102. package/plugin/skills/lit-pptx/references/stages/autopilot.md +30 -70
  103. package/plugin/skills/lit-pptx/references/stages/interview.md +36 -68
  104. package/plugin/skills/lit-pptx/references/stages/plan.md +26 -67
  105. package/plugin/skills/lit-pptx/references/title-treatments.md +93 -145
  106. package/plugin/skills/lit-pptx/references/tonalities/atlas.md +95 -108
  107. package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +140 -0
  108. package/plugin/skills/lit-pptx/references/tonalities/chalk.md +107 -122
  109. package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +150 -0
  110. package/plugin/skills/lit-pptx/references/tonalities/gazette.md +87 -111
  111. package/plugin/skills/lit-pptx/references/tonalities/ledger.md +96 -125
  112. package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +161 -0
  113. package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +144 -0
  114. package/plugin/skills/lit-pptx/references/tonalities/night.md +104 -131
  115. package/plugin/skills/lit-pptx/references/tonalities/paper.md +114 -130
  116. package/plugin/skills/lit-pptx/references/tonalities/riso.md +137 -0
  117. package/plugin/skills/lit-pptx/references/tonalities/signal.md +96 -103
  118. package/plugin/skills/lit-pptx/references/tonalities/studio.md +81 -112
  119. package/plugin/skills/lit-pptx/scripts/compile-deck.js +4 -6
  120. package/plugin/skills/lit-pptx/scripts/craft_extras.py +135 -91
  121. package/plugin/skills/lit-pptx/scripts/deck_craft.py +1 -1
  122. package/plugin/skills/lit-pptx/scripts/embed_fonts.py +13 -1
  123. package/plugin/skills/lit-pptx/scripts/layout_inventory.py +1 -1
  124. package/plugin/skills/lit-pptx/scripts/learn_template.py +1 -1
  125. package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
  126. package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
  127. package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +370 -563
  128. package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
  129. package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
  130. package/plugin/skills/lit-pptx/scripts/qa_deck.py +6 -6
  131. package/plugin/skills/lit-pptx/scripts/render_pages.py +31 -0
  132. package/plugin/skills/lit-pptx/scripts/validate_pptx.py +1 -1
  133. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +167 -191
  134. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +117 -166
  135. package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +307 -330
  136. package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
  137. package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
  138. package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
  139. package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +99 -0
  140. package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
  141. package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
  142. package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
  143. package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
  144. package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
  145. package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
  146. package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
  147. package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
  148. package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
  149. package/plugin/skills/lit-schematic/SKILL.md +114 -0
  150. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
  151. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
  152. package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
  153. package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
  154. package/plugin/skills/lit-schematic/references/cutaway-outputs.md +70 -0
  155. package/plugin/skills/lit-schematic/references/isometric-craft.md +101 -0
  156. package/plugin/skills/lit-schematic/references/journal-figures.md +72 -0
  157. package/plugin/skills/lit-schematic/references/kit-api.md +134 -0
  158. package/plugin/skills/lit-schematic/references/pfd-and-layout.md +53 -0
  159. package/plugin/skills/lit-schematic/references/pid-drafting.md +103 -0
  160. package/plugin/skills/lit-schematic/references/pid-symbols.md +163 -0
  161. package/plugin/skills/lit-schematic/references/verification.md +100 -0
  162. package/plugin/skills/lit-schematic/scripts/doctor.mjs +57 -0
  163. package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
  164. package/plugin/skills/lit-schematic/scripts/lib/fonts.mjs +27 -0
  165. package/plugin/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
  166. package/plugin/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
  167. package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
  168. package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
  169. package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
  170. package/plugin/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
  171. package/plugin/skills/lit-schematic/scripts/lib/png.mjs +132 -0
  172. package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
  173. package/plugin/skills/lit-schematic/scripts/lib/route.mjs +218 -0
  174. package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
  175. package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
  176. package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
  177. package/plugin/skills/lit-schematic/scripts/motion.mjs +129 -0
  178. package/plugin/skills/lit-schematic/scripts/qa.mjs +92 -0
  179. package/plugin/skills/lit-schematic/scripts/render.mjs +233 -0
  180. package/plugin/skills/lit-schematic/scripts/scaffold.mjs +60 -0
  181. package/plugin/skills/lit-scientific-visualization/SKILL.md +17 -6
  182. package/plugin/skills/lit-typographic-motion/SKILL.md +58 -48
  183. package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +13 -2
  184. package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +218 -0
  185. package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +1 -1
  186. package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +65 -1
  187. package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +298 -0
  188. package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +143 -0
  189. package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +136 -0
  190. package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +7 -1
  191. package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +9 -12
  192. package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +5 -3
  193. package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +7 -6
  194. package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +37 -4
  195. package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +19 -8
  196. package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +45 -6
  197. package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +7 -5
  198. package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +121 -0
  199. package/plugin/skills/lit-typographic-motion/engine/node/host.mjs +34 -0
  200. package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +44 -0
  201. package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +34 -20
  202. package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +19 -9
  203. package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +210 -0
  204. package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +639 -0
  205. package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +21 -4
  206. package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +127 -29
  207. package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +7 -6
  208. package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +59 -5
  209. package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +141 -9
  210. package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +28 -5
  211. package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +82 -14
  212. package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +213 -0
  213. package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +311 -10
  214. package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +14 -2
  215. package/plugin/skills/lit-typographic-motion/engine/stage/init.js +11 -1
  216. package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +6 -1
  217. package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +83 -0
  218. package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
  219. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
  220. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
  221. package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
  222. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +69 -0
  223. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
  224. package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +6 -4
  225. package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +4 -2
  226. package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +7 -5
  227. package/plugin/skills/lit-typographic-motion/references/cover.md +394 -443
  228. package/plugin/skills/lit-typographic-motion/references/craft-loop.md +57 -87
  229. package/plugin/skills/lit-typographic-motion/references/depth.md +122 -0
  230. package/plugin/skills/lit-typographic-motion/references/look.md +94 -129
  231. package/plugin/skills/lit-typographic-motion/references/runtime.md +58 -91
  232. package/plugin/skills/lit-typographic-motion/references/sound.md +130 -99
  233. package/plugin/skills/lit-typographic-motion/references/stage.md +190 -215
  234. package/plugin/skills/lit-typographic-motion/references/studio.md +245 -0
  235. package/plugin/skills/lit-typographic-motion/references/style-bibles.md +108 -97
  236. package/plugin/skills/lit-typographic-motion/references/treatment.md +191 -143
  237. package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +17 -5
  238. package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +47 -7
  239. package/plugin/skills/lit-typographic-motion/styles/paper.json +41 -0
  240. package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +41 -0
  241. package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +42 -0
  242. package/plugin/skills/lit-typographic-motion/styles/tidal.json +41 -0
  243. package/plugin/skills/litresearch/SKILL.md +1 -0
  244. package/plugin/skills/readme-studio/SKILL.md +2 -0
  245. package/plugin/skills/review-work/SKILL.md +1 -1
  246. package/plugin/skills/start-work/SKILL.md +1 -1
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright © 2010-2024 three.js authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,144 @@
1
+ /**
2
+ * https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
3
+ */
4
+
5
+ import {
6
+ BackSide,
7
+ BoxGeometry,
8
+ Mesh,
9
+ MeshBasicMaterial,
10
+ MeshStandardMaterial,
11
+ PointLight,
12
+ Scene,
13
+ } from 'three';
14
+
15
+ class RoomEnvironment extends Scene {
16
+
17
+ constructor() {
18
+
19
+ super();
20
+
21
+ const geometry = new BoxGeometry();
22
+ geometry.deleteAttribute( 'uv' );
23
+
24
+ const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
25
+ const boxMaterial = new MeshStandardMaterial();
26
+
27
+ const mainLight = new PointLight( 0xffffff, 900, 28, 2 );
28
+ mainLight.position.set( 0.418, 16.199, 0.300 );
29
+ this.add( mainLight );
30
+
31
+ const room = new Mesh( geometry, roomMaterial );
32
+ room.position.set( - 0.757, 13.219, 0.717 );
33
+ room.scale.set( 31.713, 28.305, 28.591 );
34
+ this.add( room );
35
+
36
+ const box1 = new Mesh( geometry, boxMaterial );
37
+ box1.position.set( - 10.906, 2.009, 1.846 );
38
+ box1.rotation.set( 0, - 0.195, 0 );
39
+ box1.scale.set( 2.328, 7.905, 4.651 );
40
+ this.add( box1 );
41
+
42
+ const box2 = new Mesh( geometry, boxMaterial );
43
+ box2.position.set( - 5.607, - 0.754, - 0.758 );
44
+ box2.rotation.set( 0, 0.994, 0 );
45
+ box2.scale.set( 1.970, 1.534, 3.955 );
46
+ this.add( box2 );
47
+
48
+ const box3 = new Mesh( geometry, boxMaterial );
49
+ box3.position.set( 6.167, 0.857, 7.803 );
50
+ box3.rotation.set( 0, 0.561, 0 );
51
+ box3.scale.set( 3.927, 6.285, 3.687 );
52
+ this.add( box3 );
53
+
54
+ const box4 = new Mesh( geometry, boxMaterial );
55
+ box4.position.set( - 2.017, 0.018, 6.124 );
56
+ box4.rotation.set( 0, 0.333, 0 );
57
+ box4.scale.set( 2.002, 4.566, 2.064 );
58
+ this.add( box4 );
59
+
60
+ const box5 = new Mesh( geometry, boxMaterial );
61
+ box5.position.set( 2.291, - 0.756, - 2.621 );
62
+ box5.rotation.set( 0, - 0.286, 0 );
63
+ box5.scale.set( 1.546, 1.552, 1.496 );
64
+ this.add( box5 );
65
+
66
+ const box6 = new Mesh( geometry, boxMaterial );
67
+ box6.position.set( - 2.193, - 0.369, - 5.547 );
68
+ box6.rotation.set( 0, 0.516, 0 );
69
+ box6.scale.set( 3.875, 3.487, 2.986 );
70
+ this.add( box6 );
71
+
72
+
73
+ // -x right
74
+ const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
75
+ light1.position.set( - 16.116, 14.37, 8.208 );
76
+ light1.scale.set( 0.1, 2.428, 2.739 );
77
+ this.add( light1 );
78
+
79
+ // -x left
80
+ const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
81
+ light2.position.set( - 16.109, 18.021, - 8.207 );
82
+ light2.scale.set( 0.1, 2.425, 2.751 );
83
+ this.add( light2 );
84
+
85
+ // +x
86
+ const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
87
+ light3.position.set( 14.904, 12.198, - 1.832 );
88
+ light3.scale.set( 0.15, 4.265, 6.331 );
89
+ this.add( light3 );
90
+
91
+ // +z
92
+ const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
93
+ light4.position.set( - 0.462, 8.89, 14.520 );
94
+ light4.scale.set( 4.38, 5.441, 0.088 );
95
+ this.add( light4 );
96
+
97
+ // -z
98
+ const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
99
+ light5.position.set( 3.235, 11.486, - 12.541 );
100
+ light5.scale.set( 2.5, 2.0, 0.1 );
101
+ this.add( light5 );
102
+
103
+ // +y
104
+ const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
105
+ light6.position.set( 0.0, 20.0, 0.0 );
106
+ light6.scale.set( 1.0, 0.1, 1.0 );
107
+ this.add( light6 );
108
+
109
+ }
110
+
111
+ dispose() {
112
+
113
+ const resources = new Set();
114
+
115
+ this.traverse( ( object ) => {
116
+
117
+ if ( object.isMesh ) {
118
+
119
+ resources.add( object.geometry );
120
+ resources.add( object.material );
121
+
122
+ }
123
+
124
+ } );
125
+
126
+ for ( const resource of resources ) {
127
+
128
+ resource.dispose();
129
+
130
+ }
131
+
132
+ }
133
+
134
+ }
135
+
136
+ function createAreaLightMaterial( intensity ) {
137
+
138
+ const material = new MeshBasicMaterial();
139
+ material.color.setScalar( intensity );
140
+ return material;
141
+
142
+ }
143
+
144
+ export { RoomEnvironment };
@@ -0,0 +1,155 @@
1
+ import {
2
+ BoxGeometry,
3
+ Vector3
4
+ } from 'three';
5
+
6
+ const _tempNormal = new Vector3();
7
+
8
+ function getUv( faceDirVector, normal, uvAxis, projectionAxis, radius, sideLength ) {
9
+
10
+ const totArcLength = 2 * Math.PI * radius / 4;
11
+
12
+ // length of the planes between the arcs on each axis
13
+ const centerLength = Math.max( sideLength - 2 * radius, 0 );
14
+ const halfArc = Math.PI / 4;
15
+
16
+ // Get the vector projected onto the Y plane
17
+ _tempNormal.copy( normal );
18
+ _tempNormal[ projectionAxis ] = 0;
19
+ _tempNormal.normalize();
20
+
21
+ // total amount of UV space alloted to a single arc
22
+ const arcUvRatio = 0.5 * totArcLength / ( totArcLength + centerLength );
23
+
24
+ // the distance along one arc the point is at
25
+ const arcAngleRatio = 1.0 - ( _tempNormal.angleTo( faceDirVector ) / halfArc );
26
+
27
+ if ( Math.sign( _tempNormal[ uvAxis ] ) === 1 ) {
28
+
29
+ return arcAngleRatio * arcUvRatio;
30
+
31
+ } else {
32
+
33
+ // total amount of UV space alloted to the plane between the arcs
34
+ const lenUv = centerLength / ( totArcLength + centerLength );
35
+ return lenUv + arcUvRatio + arcUvRatio * ( 1.0 - arcAngleRatio );
36
+
37
+ }
38
+
39
+ }
40
+
41
+ class RoundedBoxGeometry extends BoxGeometry {
42
+
43
+ constructor( width = 1, height = 1, depth = 1, segments = 2, radius = 0.1 ) {
44
+
45
+ // ensure segments is odd so we have a plane connecting the rounded corners
46
+ segments = segments * 2 + 1;
47
+
48
+ // ensure radius isn't bigger than shortest side
49
+ radius = Math.min( width / 2, height / 2, depth / 2, radius );
50
+
51
+ super( 1, 1, 1, segments, segments, segments );
52
+
53
+ // if we just have one segment we're the same as a regular box
54
+ if ( segments === 1 ) return;
55
+
56
+ const geometry2 = this.toNonIndexed();
57
+
58
+ this.index = null;
59
+ this.attributes.position = geometry2.attributes.position;
60
+ this.attributes.normal = geometry2.attributes.normal;
61
+ this.attributes.uv = geometry2.attributes.uv;
62
+
63
+ //
64
+
65
+ const position = new Vector3();
66
+ const normal = new Vector3();
67
+
68
+ const box = new Vector3( width, height, depth ).divideScalar( 2 ).subScalar( radius );
69
+
70
+ const positions = this.attributes.position.array;
71
+ const normals = this.attributes.normal.array;
72
+ const uvs = this.attributes.uv.array;
73
+
74
+ const faceTris = positions.length / 6;
75
+ const faceDirVector = new Vector3();
76
+ const halfSegmentSize = 0.5 / segments;
77
+
78
+ for ( let i = 0, j = 0; i < positions.length; i += 3, j += 2 ) {
79
+
80
+ position.fromArray( positions, i );
81
+ normal.copy( position );
82
+ normal.x -= Math.sign( normal.x ) * halfSegmentSize;
83
+ normal.y -= Math.sign( normal.y ) * halfSegmentSize;
84
+ normal.z -= Math.sign( normal.z ) * halfSegmentSize;
85
+ normal.normalize();
86
+
87
+ positions[ i + 0 ] = box.x * Math.sign( position.x ) + normal.x * radius;
88
+ positions[ i + 1 ] = box.y * Math.sign( position.y ) + normal.y * radius;
89
+ positions[ i + 2 ] = box.z * Math.sign( position.z ) + normal.z * radius;
90
+
91
+ normals[ i + 0 ] = normal.x;
92
+ normals[ i + 1 ] = normal.y;
93
+ normals[ i + 2 ] = normal.z;
94
+
95
+ const side = Math.floor( i / faceTris );
96
+
97
+ switch ( side ) {
98
+
99
+ case 0: // right
100
+
101
+ // generate UVs along Z then Y
102
+ faceDirVector.set( 1, 0, 0 );
103
+ uvs[ j + 0 ] = getUv( faceDirVector, normal, 'z', 'y', radius, depth );
104
+ uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'z', radius, height );
105
+ break;
106
+
107
+ case 1: // left
108
+
109
+ // generate UVs along Z then Y
110
+ faceDirVector.set( - 1, 0, 0 );
111
+ uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'z', 'y', radius, depth );
112
+ uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'z', radius, height );
113
+ break;
114
+
115
+ case 2: // top
116
+
117
+ // generate UVs along X then Z
118
+ faceDirVector.set( 0, 1, 0 );
119
+ uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'z', radius, width );
120
+ uvs[ j + 1 ] = getUv( faceDirVector, normal, 'z', 'x', radius, depth );
121
+ break;
122
+
123
+ case 3: // bottom
124
+
125
+ // generate UVs along X then Z
126
+ faceDirVector.set( 0, - 1, 0 );
127
+ uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'z', radius, width );
128
+ uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'z', 'x', radius, depth );
129
+ break;
130
+
131
+ case 4: // front
132
+
133
+ // generate UVs along X then Y
134
+ faceDirVector.set( 0, 0, 1 );
135
+ uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'y', radius, width );
136
+ uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'x', radius, height );
137
+ break;
138
+
139
+ case 5: // back
140
+
141
+ // generate UVs along X then Y
142
+ faceDirVector.set( 0, 0, - 1 );
143
+ uvs[ j + 0 ] = getUv( faceDirVector, normal, 'x', 'y', radius, width );
144
+ uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'x', radius, height );
145
+ break;
146
+
147
+ }
148
+
149
+ }
150
+
151
+ }
152
+
153
+ }
154
+
155
+ export { RoundedBoxGeometry };