@pixel-normal-edit/mcp 2.1.0 → 2.2.0
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.
- package/clear-firebase.js +37 -0
- package/domains/art-tree/README.md +134 -0
- package/domains/art-tree/REORGANIZATION_PLAN.md +168 -0
- package/domains/art-tree/REORGANIZATION_SUMMARY.md +260 -0
- package/domains/art-tree/index.js +58 -58
- package/domains/art-tree/lessons/3d/box-properties.js +38 -0
- package/domains/art-tree/lessons/3d/cone-properties.js +31 -0
- package/domains/art-tree/lessons/3d/cylinder-properties.js +29 -0
- package/domains/art-tree/lessons/3d/sphere-properties.js +25 -0
- package/domains/art-tree/lessons/advanced/angles.js +30 -0
- package/domains/art-tree/lessons/advanced/distances.js +26 -0
- package/domains/art-tree/lessons/advanced/shape-ratios.js +25 -0
- package/domains/art-tree/lessons/advanced/shape-relationships.js +28 -0
- package/domains/art-tree/lessons/advanced/symmetry-and-axis.js +26 -0
- package/domains/art-tree/{analysis_lessons.js → lessons/analysis/object-analysis.js} +5 -16
- package/domains/art-tree/lessons/basic/circles.js +26 -0
- package/domains/art-tree/lessons/basic/composition.js +34 -0
- package/domains/art-tree/lessons/basic/curves.js +31 -0
- package/domains/art-tree/lessons/basic/ellipses.js +26 -0
- package/domains/art-tree/lessons/basic/freehand.js +19 -0
- package/domains/art-tree/lessons/basic/index.js +36 -0
- package/domains/art-tree/lessons/basic/lines.js +38 -0
- package/domains/art-tree/lessons/basic/parallel-and-intersecting.js +22 -0
- package/domains/art-tree/lessons/basic/polygons.js +25 -0
- package/domains/art-tree/lessons/basic/proportions-and-angles.js +20 -0
- package/domains/art-tree/lessons/basic/spiral.js +21 -0
- package/domains/art-tree/lessons/basic/squares.js +28 -0
- package/domains/art-tree/lessons/basic/strokes.js +23 -0
- package/domains/art-tree/lessons/basic/triangles.js +30 -0
- package/domains/art-tree/lessons/cross-sections/bottle-sections.js +26 -0
- package/domains/art-tree/lessons/cross-sections/glass-sections.js +24 -0
- package/domains/art-tree/lessons/cross-sections/head-sections.js +17 -0
- package/domains/art-tree/lessons/curves/curve-properties.js +50 -0
- package/domains/art-tree/lessons/curves/curve-topology.js +45 -0
- package/domains/art-tree/lessons/curves/curve-types.js +44 -0
- package/domains/art-tree/lessons/ellipses/coaxial-ellipses.js +29 -0
- package/domains/art-tree/lessons/ellipses/ellipse-anatomy.js +26 -0
- package/domains/art-tree/lessons/ellipses/ellipse-orientations.js +28 -0
- package/domains/art-tree/lessons/ellipses/ellipse-proportions.js +27 -0
- package/domains/art-tree/lessons/hidden/hidden-box.js +20 -0
- package/domains/art-tree/lessons/hidden/hidden-cup.js +19 -0
- package/domains/art-tree/lessons/hidden/hidden-head.js +18 -0
- package/domains/art-tree/lessons/index.js +42 -0
- package/domains/art-tree/{layer_lessons.js → lessons/layers/layer-step.js} +5 -16
- package/domains/art-tree/lessons/lighting/contact-shadow.js +33 -0
- package/domains/art-tree/lessons/lighting/light-direction.js +30 -0
- package/domains/art-tree/lessons/lighting/light-zones.js +30 -0
- package/domains/art-tree/lessons/materials/material-glass.js +21 -0
- package/domains/art-tree/lessons/materials/material-shiny.js +26 -0
- package/domains/art-tree/lessons/materials/material-texture.js +26 -0
- package/domains/art-tree/lessons/perspective/1point-perspective.js +30 -0
- package/domains/art-tree/lessons/perspective/2point-perspective.js +30 -0
- package/domains/art-tree/lessons/perspective/3point-perspective.js +45 -0
- package/domains/art-tree/lessons/perspective/foreshortening.js +38 -0
- package/domains/art-tree/lessons/sky/sun-shapes.js +25 -0
- package/domains/art-tree/lessons/sky/sunset-colors.js +27 -0
- package/domains/art-tree/lessons/sky/sunset-sky.js +32 -0
- package/domains/art-tree/{structure_lessons.js → lessons/structure/axis-orientation.js} +3 -53
- package/domains/art-tree/lessons/structure/complex-structure.js +21 -0
- package/domains/art-tree/lessons/structure/x-yzaxes.js +28 -0
- package/domains/art-tree/lessons/surfaces/chair-analysis.js +17 -0
- package/domains/art-tree/lessons/surfaces/cup-analysis.js +18 -0
- package/domains/art-tree/lessons/surfaces/edge-types.js +40 -0
- package/domains/art-tree/lessons/surfaces/surface-types.js +42 -0
- package/domains/art-tree/lessons/transforms/bend.js +27 -0
- package/domains/art-tree/{transform_lessons_2.js → lessons/transforms/combine.js} +3 -54
- package/domains/art-tree/lessons/transforms/cut.js +25 -0
- package/domains/art-tree/lessons/transforms/hollow.js +24 -0
- package/domains/art-tree/lessons/transforms/rotate.js +16 -0
- package/domains/art-tree/lessons/transforms/squash.js +31 -0
- package/domains/art-tree/lessons/transforms/stretch.js +31 -0
- package/domains/art-tree/lessons/transforms/taper-swell.js +33 -0
- package/domains/art-tree/{vocab_lessons.js → lessons/vocab/vocab-house.js} +5 -16
- package/domains/art-tree/lib/tool-register.js +104 -0
- package/domains/art-tree/lib/validators.js +78 -0
- package/domains/art-tree/shapes/grid.js +37 -0
- package/domains/art-tree/shapes/polyline.js +26 -0
- package/domains/art-tree/{3d_tools.js → tools/3d.js} +2 -2
- package/domains/art-tree/{advanced_tools.js → tools/advanced.js} +2 -2
- package/domains/art-tree/{analysis_tools.js → tools/analysis.js} +2 -2
- package/domains/art-tree/{tools.js → tools/basic.js} +3 -3
- package/domains/art-tree/{cross_section_tools.js → tools/cross-sections.js} +2 -2
- package/domains/art-tree/{curve_tools.js → tools/curves.js} +2 -2
- package/domains/art-tree/{ellipse_tools.js → tools/ellipses.js} +2 -2
- package/domains/art-tree/{hidden_tools.js → tools/hidden.js} +2 -2
- package/domains/art-tree/tools/index.js +53 -0
- package/domains/art-tree/{layer_tools.js → tools/layers.js} +2 -2
- package/domains/art-tree/{light_tools.js → tools/lighting.js} +2 -2
- package/domains/art-tree/{material_tools.js → tools/materials.js} +2 -2
- package/domains/art-tree/{perspective_tools.js → tools/perspective.js} +2 -2
- package/domains/art-tree/{sky_tools.js → tools/sky.js} +2 -2
- package/domains/art-tree/{structure_tools.js → tools/structure.js} +2 -2
- package/domains/art-tree/{surface_tools.js → tools/surfaces.js} +2 -2
- package/domains/art-tree/{transform_tools.js → tools/transforms.js} +3 -3
- package/domains/art-tree/{vocab_tools.js → tools/vocab.js} +2 -2
- package/package.json +1 -1
- package/rules/prerequisites.js +30 -30
- package/rules/rules.js +1 -1
- package/rules/workflow.js +28 -20
- package/tools/canvas-tools.js +2 -2
- package/tools/drawing-tools.js +23 -12
- package/tools/workspace-tools.js +5 -4
- package/domains/art-tree/3d_lessons.js +0 -114
- package/domains/art-tree/advanced_lessons.js +0 -124
- package/domains/art-tree/cross_section_lessons.js +0 -65
- package/domains/art-tree/curve_lessons.js +0 -138
- package/domains/art-tree/ellipse_lessons.js +0 -105
- package/domains/art-tree/hidden_lessons.js +0 -55
- package/domains/art-tree/lessons.js +0 -305
- package/domains/art-tree/light_lessons.js +0 -92
- package/domains/art-tree/material_lessons.js +0 -71
- package/domains/art-tree/perspective_lessons.js +0 -138
- package/domains/art-tree/sky_lessons_1.js +0 -82
- package/domains/art-tree/surface_lessons.js +0 -112
- package/domains/art-tree/transform_lessons_1.js +0 -108
- /package/domains/art-tree/{3d_shapes.js → shapes/3d.js} +0 -0
- /package/domains/art-tree/{advanced_shapes.js → shapes/advanced.js} +0 -0
- /package/domains/art-tree/{analysis_shapes.js → shapes/analysis.js} +0 -0
- /package/domains/art-tree/{shapes.js → shapes/basic.js} +0 -0
- /package/domains/art-tree/{cross_section_shapes.js → shapes/cross-sections.js} +0 -0
- /package/domains/art-tree/{curve_shapes.js → shapes/curves.js} +0 -0
- /package/domains/art-tree/{ellipse_shapes.js → shapes/ellipses.js} +0 -0
- /package/domains/art-tree/{hidden_shapes.js → shapes/hidden.js} +0 -0
- /package/domains/art-tree/{layer_shapes.js → shapes/layers.js} +0 -0
- /package/domains/art-tree/{light_shapes.js → shapes/lighting.js} +0 -0
- /package/domains/art-tree/{material_shapes.js → shapes/materials.js} +0 -0
- /package/domains/art-tree/{perspective_shapes.js → shapes/perspective.js} +0 -0
- /package/domains/art-tree/{sky_shapes_1.js → shapes/sky.js} +0 -0
- /package/domains/art-tree/{structure_shapes.js → shapes/structure.js} +0 -0
- /package/domains/art-tree/{surface_shapes.js → shapes/surfaces.js} +0 -0
- /package/domains/art-tree/{transform_shapes.js → shapes/transforms.js} +0 -0
- /package/domains/art-tree/{vocab_shapes.js → shapes/vocab.js} +0 -0
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* domains/art-tree/index.js — Art Tree Module Aggregator
|
|
4
|
-
*
|
|
5
|
-
* Aggregates and exports all Art Tree module components.
|
|
6
|
-
* To add new features to this module, create a new file and add it here.
|
|
7
|
-
*
|
|
8
|
-
* Module namespace: art_tree_* (all tools prefixed with art_tree_)
|
|
9
|
-
*/
|
|
10
|
-
const shapes = require('./shapes');
|
|
11
|
-
const lessons = require('./lessons');
|
|
12
|
-
const tools = require('./tools');
|
|
13
|
-
const advTools = require('./advanced_tools');
|
|
14
|
-
const curveTools = require('./curve_tools');
|
|
15
|
-
const ellipseTools = require('./ellipse_tools');
|
|
16
|
-
const tools3d = require('./3d_tools');
|
|
17
|
-
const structureTools = require('./structure_tools');
|
|
18
|
-
const csTools = require('./cross_section_tools');
|
|
19
|
-
const transformTools = require('./transform_tools');
|
|
20
|
-
const surfaceTools = require('./surface_tools');
|
|
21
|
-
const perspTools = require('./perspective_tools');
|
|
22
|
-
const hiddenTools = require('./hidden_tools');
|
|
23
|
-
const lightTools = require('./light_tools');
|
|
24
|
-
const materialTools = require('./material_tools');
|
|
25
|
-
const analysisTools = require('./analysis_tools');
|
|
26
|
-
const layerTools = require('./layer_tools');
|
|
27
|
-
const skyTools = require('./sky_tools');
|
|
28
|
-
const vocabTools = require('./vocab_tools');
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Register all Art Tree MCP tools on the server
|
|
32
|
-
* @param {McpServer} server
|
|
33
|
-
*/
|
|
34
|
-
function registerAll(server) {
|
|
35
|
-
tools.register(server);
|
|
36
|
-
advTools.register(server);
|
|
37
|
-
curveTools.register(server);
|
|
38
|
-
ellipseTools.register(server);
|
|
39
|
-
tools3d.register(server);
|
|
40
|
-
structureTools.register(server);
|
|
41
|
-
csTools.register(server);
|
|
42
|
-
transformTools.register(server);
|
|
43
|
-
surfaceTools.register(server);
|
|
44
|
-
perspTools.register(server);
|
|
45
|
-
hiddenTools.register(server);
|
|
46
|
-
lightTools.register(server);
|
|
47
|
-
materialTools.register(server);
|
|
48
|
-
analysisTools.register(server);
|
|
49
|
-
layerTools.register(server);
|
|
50
|
-
skyTools.register(server);
|
|
51
|
-
vocabTools.register(server);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = {
|
|
55
|
-
shapes,
|
|
56
|
-
lessons,
|
|
57
|
-
tools,
|
|
58
|
-
registerAll,
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* domains/art-tree/index.js — Art Tree Module Aggregator
|
|
4
|
+
*
|
|
5
|
+
* Aggregates and exports all Art Tree module components.
|
|
6
|
+
* To add new features to this module, create a new file and add it here.
|
|
7
|
+
*
|
|
8
|
+
* Module namespace: art_tree_* (all tools prefixed with art_tree_)
|
|
9
|
+
*/
|
|
10
|
+
const shapes = require('./shapes');
|
|
11
|
+
const lessons = require('./lessons');
|
|
12
|
+
const tools = require('./tools');
|
|
13
|
+
const advTools = require('./advanced_tools');
|
|
14
|
+
const curveTools = require('./curve_tools');
|
|
15
|
+
const ellipseTools = require('./ellipse_tools');
|
|
16
|
+
const tools3d = require('./3d_tools');
|
|
17
|
+
const structureTools = require('./structure_tools');
|
|
18
|
+
const csTools = require('./cross_section_tools');
|
|
19
|
+
const transformTools = require('./transform_tools');
|
|
20
|
+
const surfaceTools = require('./surface_tools');
|
|
21
|
+
const perspTools = require('./perspective_tools');
|
|
22
|
+
const hiddenTools = require('./hidden_tools');
|
|
23
|
+
const lightTools = require('./light_tools');
|
|
24
|
+
const materialTools = require('./material_tools');
|
|
25
|
+
const analysisTools = require('./analysis_tools');
|
|
26
|
+
const layerTools = require('./layer_tools');
|
|
27
|
+
const skyTools = require('./sky_tools');
|
|
28
|
+
const vocabTools = require('./vocab_tools');
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Register all Art Tree MCP tools on the server
|
|
32
|
+
* @param {McpServer} server
|
|
33
|
+
*/
|
|
34
|
+
function registerAll(server) {
|
|
35
|
+
tools.register(server);
|
|
36
|
+
advTools.register(server);
|
|
37
|
+
curveTools.register(server);
|
|
38
|
+
ellipseTools.register(server);
|
|
39
|
+
tools3d.register(server);
|
|
40
|
+
structureTools.register(server);
|
|
41
|
+
csTools.register(server);
|
|
42
|
+
transformTools.register(server);
|
|
43
|
+
surfaceTools.register(server);
|
|
44
|
+
perspTools.register(server);
|
|
45
|
+
hiddenTools.register(server);
|
|
46
|
+
lightTools.register(server);
|
|
47
|
+
materialTools.register(server);
|
|
48
|
+
analysisTools.register(server);
|
|
49
|
+
layerTools.register(server);
|
|
50
|
+
skyTools.register(server);
|
|
51
|
+
vocabTools.register(server);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = {
|
|
55
|
+
shapes,
|
|
56
|
+
lessons,
|
|
57
|
+
tools,
|
|
58
|
+
registerAll,
|
|
59
59
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from 3d_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Box Properties (Width, Height, Depth, Planes, Edges)
|
|
9
|
+
*/
|
|
10
|
+
function lessonBoxProperties(canvasSize = 32, color = '#2196f3') {
|
|
11
|
+
const commands = [];
|
|
12
|
+
const cx = Math.floor(canvasSize / 2);
|
|
13
|
+
const cy = Math.floor(canvasSize / 2);
|
|
14
|
+
const w = Math.floor(canvasSize * 0.4);
|
|
15
|
+
const h = Math.floor(canvasSize * 0.4);
|
|
16
|
+
const d = Math.floor(canvasSize * 0.3);
|
|
17
|
+
|
|
18
|
+
// Draw wireframe box
|
|
19
|
+
commands.push(...shapes3d.drawWireframeBox(cx, cy, w, h, d, color));
|
|
20
|
+
|
|
21
|
+
// Highlight dimensions
|
|
22
|
+
const fX = cx - Math.floor(w/2);
|
|
23
|
+
const fY = cy - Math.floor(h/2);
|
|
24
|
+
|
|
25
|
+
// Width
|
|
26
|
+
commands.push(...advShapes.drawDistance(fX, fY + h + 2, fX + w, fY + h + 2, '#4caf50'));
|
|
27
|
+
// Height
|
|
28
|
+
commands.push(...advShapes.drawDistance(fX - 2, fY, fX - 2, fY + h, '#ff9800'));
|
|
29
|
+
|
|
30
|
+
// Depth (approximate along the oblique edge)
|
|
31
|
+
const dx = Math.floor(d * 0.7);
|
|
32
|
+
const dy = Math.floor(d * 0.5);
|
|
33
|
+
commands.push(...advShapes.drawDistance(fX + w + 2, fY + h, fX + w + 2 + dx, fY + h - dy, '#e91e63'));
|
|
34
|
+
|
|
35
|
+
return commands;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = { lessonBoxProperties };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from 3d_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Cone Properties (Apex, Base, Axis)
|
|
9
|
+
*/
|
|
10
|
+
function lessonConeProperties(canvasSize = 32, color = '#ff5722') {
|
|
11
|
+
const commands = [];
|
|
12
|
+
const cx = Math.floor(canvasSize / 2);
|
|
13
|
+
const cy = Math.floor(canvasSize / 2);
|
|
14
|
+
const r = Math.floor(canvasSize * 0.35);
|
|
15
|
+
const h = Math.floor(canvasSize * 0.6);
|
|
16
|
+
|
|
17
|
+
// Draw cone volume
|
|
18
|
+
commands.push(...shapes3d.drawConeVolume(cx, cy, r, h, color));
|
|
19
|
+
|
|
20
|
+
// Highlight Height
|
|
21
|
+
const apexY = cy - Math.floor(h/2);
|
|
22
|
+
const baseY = cy + Math.floor(h/2);
|
|
23
|
+
commands.push(...advShapes.drawDistance(cx + r + 4, apexY, cx + r + 4, baseY, '#4caf50'));
|
|
24
|
+
|
|
25
|
+
// Highlight Radius (base)
|
|
26
|
+
commands.push(...advShapes.drawDistance(cx, baseY, cx + r, baseY, '#ff9800'));
|
|
27
|
+
|
|
28
|
+
return commands;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = { lessonConeProperties };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from 3d_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Cylinder Properties (Central axis, Bases, Perspective change)
|
|
9
|
+
*/
|
|
10
|
+
function lessonCylinderProperties(canvasSize = 32, color = '#00bcd4') {
|
|
11
|
+
const commands = [];
|
|
12
|
+
const cx = Math.floor(canvasSize / 2);
|
|
13
|
+
const cy = Math.floor(canvasSize / 2);
|
|
14
|
+
const r = Math.floor(canvasSize * 0.3);
|
|
15
|
+
const h = Math.floor(canvasSize * 0.6);
|
|
16
|
+
|
|
17
|
+
// Draw cylinder volume
|
|
18
|
+
commands.push(...shapes3d.drawCylinderVolume(cx, cy, r, h, color));
|
|
19
|
+
|
|
20
|
+
// Highlight Height
|
|
21
|
+
commands.push(...advShapes.drawDistance(cx + r + 4, cy - Math.floor(h/2), cx + r + 4, cy + Math.floor(h/2), '#4caf50'));
|
|
22
|
+
|
|
23
|
+
// Highlight Radius (top base)
|
|
24
|
+
commands.push(...advShapes.drawDistance(cx, cy - Math.floor(h/2), cx + r, cy - Math.floor(h/2), '#ff9800'));
|
|
25
|
+
|
|
26
|
+
return commands;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { lessonCylinderProperties };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from 3d_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Sphere Properties (Center, Radius, Cross contours, Axis)
|
|
9
|
+
*/
|
|
10
|
+
function lessonSphereProperties(canvasSize = 32, color = '#9c27b0') {
|
|
11
|
+
const commands = [];
|
|
12
|
+
const cx = Math.floor(canvasSize / 2);
|
|
13
|
+
const cy = Math.floor(canvasSize / 2);
|
|
14
|
+
const r = Math.floor(canvasSize * 0.35);
|
|
15
|
+
|
|
16
|
+
// Draw sphere with volume lines
|
|
17
|
+
commands.push(...shapes3d.drawSphereVolume(cx, cy, r, color));
|
|
18
|
+
|
|
19
|
+
// Highlight radius
|
|
20
|
+
commands.push(...advShapes.drawDistance(cx, cy, cx + r, cy, '#ff9800'));
|
|
21
|
+
|
|
22
|
+
return commands;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { lessonSphereProperties };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from advanced_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Angles
|
|
9
|
+
*/
|
|
10
|
+
function lessonAngles(canvasSize = 32, color = '#ff5722') {
|
|
11
|
+
const mid = Math.floor(canvasSize / 2);
|
|
12
|
+
const w = Math.floor(canvasSize * 0.6);
|
|
13
|
+
const h = Math.floor(canvasSize * 0.3);
|
|
14
|
+
const margin = Math.floor(canvasSize * 0.2);
|
|
15
|
+
|
|
16
|
+
const commands = [];
|
|
17
|
+
// Trapezoid (shows acute and obtuse angles)
|
|
18
|
+
commands.push(advShapes.drawTrapezoid(margin, margin, Math.floor(w/2), w, h, color, false));
|
|
19
|
+
|
|
20
|
+
// Right Triangle (shows 90 degree angle)
|
|
21
|
+
commands.push(shapes.drawTriangle([
|
|
22
|
+
{ x: margin, y: canvasSize - margin },
|
|
23
|
+
{ x: margin, y: mid + margin },
|
|
24
|
+
{ x: margin + w, y: canvasSize - margin }
|
|
25
|
+
], '#3f51b5', false));
|
|
26
|
+
|
|
27
|
+
return commands;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = { lessonAngles };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from advanced_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Distances
|
|
9
|
+
*/
|
|
10
|
+
function lessonDistances(canvasSize = 32, color = '#00bcd4') {
|
|
11
|
+
const margin = Math.floor(canvasSize * 0.2);
|
|
12
|
+
const commands = [];
|
|
13
|
+
|
|
14
|
+
// Points
|
|
15
|
+
commands.push(shapes.drawCircle(margin, margin, 1, color, true));
|
|
16
|
+
commands.push(shapes.drawCircle(canvasSize - margin, margin, 1, color, true));
|
|
17
|
+
commands.push(shapes.drawCircle(margin, canvasSize - margin, 1, color, true));
|
|
18
|
+
|
|
19
|
+
// Distances between them
|
|
20
|
+
commands.push(...advShapes.drawDistance(margin, margin, canvasSize - margin, margin));
|
|
21
|
+
commands.push(...advShapes.drawDistance(margin, margin, margin, canvasSize - margin));
|
|
22
|
+
|
|
23
|
+
return commands;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { lessonDistances };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from advanced_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Shape Ratios
|
|
9
|
+
*/
|
|
10
|
+
function lessonShapeRatios(canvasSize = 32, color = '#2196f3') {
|
|
11
|
+
const margin = Math.floor(canvasSize * 0.1);
|
|
12
|
+
const w1 = Math.floor(canvasSize * 0.2);
|
|
13
|
+
const h1 = w1; // 1:1
|
|
14
|
+
const w2 = Math.floor(canvasSize * 0.2);
|
|
15
|
+
const h2 = Math.floor(canvasSize * 0.4); // 1:2
|
|
16
|
+
|
|
17
|
+
return [
|
|
18
|
+
shapes.drawRectangle(margin, margin, w1, h1, color, false),
|
|
19
|
+
shapes.drawRectangle(canvasSize - margin - w2, margin, w2, h2, '#4caf50', false),
|
|
20
|
+
...advShapes.drawDistance(margin, margin + h1 + 2, margin + w1, margin + h1 + 2, '#888'),
|
|
21
|
+
...advShapes.drawDistance(canvasSize - margin - w2, margin + h2 + 2, canvasSize - margin, margin + h2 + 2, '#888')
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { lessonShapeRatios };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from advanced_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Shape Relationships
|
|
9
|
+
*/
|
|
10
|
+
function lessonShapeRelationships(canvasSize = 32, color = '#607d8b') {
|
|
11
|
+
const mid = Math.floor(canvasSize / 2);
|
|
12
|
+
const r = Math.floor(canvasSize * 0.2);
|
|
13
|
+
const commands = [];
|
|
14
|
+
|
|
15
|
+
// Overlapping circles
|
|
16
|
+
commands.push(shapes.drawCircle(mid - Math.floor(r/2), mid, r, color, false));
|
|
17
|
+
commands.push(shapes.drawCircle(mid + Math.floor(r/2), mid, r, '#e91e63', false));
|
|
18
|
+
|
|
19
|
+
// Nested squares (top left)
|
|
20
|
+
const margin = Math.floor(canvasSize * 0.1);
|
|
21
|
+
const size = Math.floor(canvasSize * 0.25);
|
|
22
|
+
commands.push(shapes.drawSquare(margin, margin, size, '#4caf50', false));
|
|
23
|
+
commands.push(shapes.drawSquare(margin + 2, margin + 2, size - 4, '#8bc34a', false));
|
|
24
|
+
|
|
25
|
+
return commands;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = { lessonShapeRelationships };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from advanced_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
const advShapes = require('../../shapes/advanced');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lesson: Symmetry & Axes
|
|
9
|
+
*/
|
|
10
|
+
function lessonSymmetryAndAxis(canvasSize = 32, color = '#9c27b0') {
|
|
11
|
+
const mid = Math.floor(canvasSize / 2);
|
|
12
|
+
const w = Math.floor(canvasSize * 0.5);
|
|
13
|
+
const h = Math.floor(canvasSize * 0.5);
|
|
14
|
+
const commands = [];
|
|
15
|
+
|
|
16
|
+
// Draw Rhombus
|
|
17
|
+
commands.push(advShapes.drawRhombus(mid, mid, w, h, color, false));
|
|
18
|
+
// Vertical axis
|
|
19
|
+
commands.push(advShapes.drawAxis(mid, Math.floor(canvasSize * 0.1), mid, canvasSize - Math.floor(canvasSize * 0.1)));
|
|
20
|
+
// Horizontal axis
|
|
21
|
+
commands.push(advShapes.drawAxis(Math.floor(canvasSize * 0.1), mid, canvasSize - Math.floor(canvasSize * 0.1), mid));
|
|
22
|
+
|
|
23
|
+
return commands;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { lessonSymmetryAndAxis };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from analysis_lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Lesson: Object Analysis (Capstone)
|
|
@@ -15,18 +18,4 @@ function lessonObjectAnalysis(canvasSize = 32, step = 1, color = '#2196f3') {
|
|
|
15
18
|
return analysisShapes.drawTeapotAnalysis(cx, cy, canvasSize, validStep, color);
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
return [
|
|
20
|
-
{
|
|
21
|
-
id: 'analysis_step',
|
|
22
|
-
name: '10-Step Object Analysis',
|
|
23
|
-
description: 'Break down a Teapot from Silhouette (1) to Lighting (10). Supply step=1..10',
|
|
24
|
-
fn: lessonObjectAnalysis
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = {
|
|
30
|
-
lessonObjectAnalysis,
|
|
31
|
-
getAnalysisLessonCatalog
|
|
32
|
-
};
|
|
21
|
+
module.exports = { lessonObjectAnalysis };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 3: Circles — Learning curves and symmetry.
|
|
8
|
+
* @param {number} canvasSize - Canvas dimension
|
|
9
|
+
* @param {string} color - Primary color
|
|
10
|
+
* @returns {Array<Object>} Array of command payloads
|
|
11
|
+
*/
|
|
12
|
+
function lessonCircles(canvasSize = 32, color = '#e91e63') {
|
|
13
|
+
const mid = Math.floor(canvasSize / 2);
|
|
14
|
+
const r1 = Math.floor(canvasSize * 0.15);
|
|
15
|
+
const r2 = Math.floor(canvasSize * 0.3);
|
|
16
|
+
return [
|
|
17
|
+
// Small circle (outline)
|
|
18
|
+
shapes.drawCircle(mid, mid, r1, color, false),
|
|
19
|
+
// Large circle (filled)
|
|
20
|
+
shapes.drawCircle(mid, mid, r2, '#2196f3', true),
|
|
21
|
+
// Small filled circle offset
|
|
22
|
+
shapes.drawCircle(mid + r1, mid - r1, Math.floor(r1 / 2), '#ff9800', true),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { lessonCircles };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 7: Composition — Combining basic shapes to create simple objects.
|
|
8
|
+
* @param {number} canvasSize - Canvas dimension
|
|
9
|
+
* @returns {Array<Object>} Array of command payloads
|
|
10
|
+
*/
|
|
11
|
+
function lessonComposition(canvasSize = 32) {
|
|
12
|
+
const mid = Math.floor(canvasSize / 2);
|
|
13
|
+
const q1 = Math.floor(canvasSize * 0.25);
|
|
14
|
+
const q3 = Math.floor(canvasSize * 0.75);
|
|
15
|
+
const small = Math.floor(canvasSize * 0.1);
|
|
16
|
+
return [
|
|
17
|
+
// House: square body
|
|
18
|
+
shapes.drawSquare(q1, mid, q3 - q1, '#8d6e63', true),
|
|
19
|
+
// House: triangle roof
|
|
20
|
+
shapes.drawTriangle([
|
|
21
|
+
{ x: q1 - 1, y: mid },
|
|
22
|
+
{ x: mid, y: q1 },
|
|
23
|
+
{ x: q3 + 1, y: mid },
|
|
24
|
+
], '#d32f2f', true),
|
|
25
|
+
// Sun: circle
|
|
26
|
+
shapes.drawCircle(canvasSize - small - 2, small + 2, small, '#ffc107', true),
|
|
27
|
+
// Tree: rectangle trunk
|
|
28
|
+
shapes.drawRectangle(q1 + small, canvasSize - small - 2, Math.floor(small / 2), small, '#5d4037', true),
|
|
29
|
+
// Tree: circle top
|
|
30
|
+
shapes.drawCircle(q1 + Math.floor(small / 4), canvasSize - small - 4, Math.floor(small / 2), '#388e3c', true),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = { lessonComposition };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 10: Curves — C-curves and S-curves.
|
|
8
|
+
*/
|
|
9
|
+
function lessonCurves(canvasSize = 32, color = '#9c27b0') {
|
|
10
|
+
const commands = [];
|
|
11
|
+
const mid = Math.floor(canvasSize / 2);
|
|
12
|
+
const r = Math.floor(canvasSize * 0.15);
|
|
13
|
+
// C curve
|
|
14
|
+
const cPoints = [];
|
|
15
|
+
for (let i = -Math.PI/2; i <= Math.PI/2; i += 0.2) {
|
|
16
|
+
cPoints.push({ x: Math.round(mid - r - r * Math.cos(i)), y: Math.round(mid / 2 + r * Math.sin(i)) });
|
|
17
|
+
}
|
|
18
|
+
commands.push(...shapes.drawPolyline(cPoints, color));
|
|
19
|
+
// S curve
|
|
20
|
+
const sPoints = [];
|
|
21
|
+
for (let i = -Math.PI/2; i <= Math.PI*1.5; i += 0.2) {
|
|
22
|
+
const isTop = i < Math.PI/2;
|
|
23
|
+
const cy = isTop ? (mid + Math.floor(canvasSize*0.1)) : (mid + Math.floor(canvasSize*0.1) + r*2);
|
|
24
|
+
const signX = isTop ? -1 : 1;
|
|
25
|
+
sPoints.push({ x: Math.round(mid + r + signX * r * Math.cos(i)), y: Math.round(cy + r * Math.sin(i)) });
|
|
26
|
+
}
|
|
27
|
+
commands.push(...shapes.drawPolyline(sPoints, '#e91e63'));
|
|
28
|
+
return commands;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = { lessonCurves };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 4: Ellipses — Understanding oval shapes and proportions.
|
|
8
|
+
* @param {number} canvasSize - Canvas dimension
|
|
9
|
+
* @param {string} color - Primary color
|
|
10
|
+
* @returns {Array<Object>} Array of command payloads
|
|
11
|
+
*/
|
|
12
|
+
function lessonEllipses(canvasSize = 32, color = '#9c27b0') {
|
|
13
|
+
const mid = Math.floor(canvasSize / 2);
|
|
14
|
+
const rx = Math.floor(canvasSize * 0.3);
|
|
15
|
+
const ry = Math.floor(canvasSize * 0.15);
|
|
16
|
+
return [
|
|
17
|
+
// Horizontal ellipse (outline)
|
|
18
|
+
shapes.drawEllipse(mid, mid, rx, ry, color, false),
|
|
19
|
+
// Vertical ellipse (filled)
|
|
20
|
+
shapes.drawEllipse(mid, mid, ry, rx, '#4caf50', true),
|
|
21
|
+
// Small circle-like ellipse
|
|
22
|
+
shapes.drawEllipse(mid + rx, mid - ry, Math.floor(rx / 3), Math.floor(ry / 2), '#ff5722', true),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = { lessonEllipses };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 8: Freehand — Practice freehand drawing with simulated hand tremor.
|
|
8
|
+
*/
|
|
9
|
+
function lessonFreehand(canvasSize = 32, color = '#795548') {
|
|
10
|
+
const margin = Math.floor(canvasSize * 0.1);
|
|
11
|
+
const points = [];
|
|
12
|
+
let y = Math.floor(canvasSize / 2);
|
|
13
|
+
for (let x = margin; x < canvasSize - margin; x += 2) {
|
|
14
|
+
points.push({ x, y: y + Math.floor(Math.random() * 3) - 1 });
|
|
15
|
+
}
|
|
16
|
+
return shapes.drawPolyline(points, color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = { lessonFreehand };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* lessons/basic/index.js — Art Tree: Basic Lessons Index
|
|
4
|
+
*
|
|
5
|
+
* Exports all basic shape lesson functions and catalog.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const lines = require('./lines');
|
|
9
|
+
const squares = require('./squares');
|
|
10
|
+
const circles = require('./circles');
|
|
11
|
+
const ellipses = require('./ellipses');
|
|
12
|
+
const triangles = require('./triangles');
|
|
13
|
+
const polygons = require('./polygons');
|
|
14
|
+
const composition = require('./composition');
|
|
15
|
+
const freehand = require('./freehand');
|
|
16
|
+
const proportions = require('./proportions');
|
|
17
|
+
const curves = require('./curves');
|
|
18
|
+
const spiral = require('./spiral');
|
|
19
|
+
const strokes = require('./strokes');
|
|
20
|
+
const parallelIntersecting = require('./parallel-intersecting');
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
...lines,
|
|
24
|
+
...squares,
|
|
25
|
+
...circles,
|
|
26
|
+
...ellipses,
|
|
27
|
+
...triangles,
|
|
28
|
+
...polygons,
|
|
29
|
+
...composition,
|
|
30
|
+
...freehand,
|
|
31
|
+
...proportions,
|
|
32
|
+
...curves,
|
|
33
|
+
...spiral,
|
|
34
|
+
...strokes,
|
|
35
|
+
...parallelIntersecting,
|
|
36
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* lessons.js — Art Tree: Basic Shapes Lessons
|
|
8
|
+
*
|
|
9
|
+
* Layer: Lesson API (built on top of Shape API)
|
|
10
|
+
*
|
|
11
|
+
* Provides structured lessons that guide learners through
|
|
12
|
+
* drawing basic geometric shapes step by step.
|
|
13
|
+
* Each lesson returns a sequence of command payloads.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Lesson 1: Lines — Introduction to drawing straight lines.
|
|
18
|
+
* Teaches horizontal, vertical, and diagonal lines.
|
|
19
|
+
* @param {number} canvasSize - Canvas dimension (assumes square)
|
|
20
|
+
* @param {string} color - Primary color for the lesson
|
|
21
|
+
* @returns {Array<Object>} Array of command payloads
|
|
22
|
+
*/
|
|
23
|
+
function lessonLines(canvasSize = 32, color = '#ff0000') {
|
|
24
|
+
const mid = Math.floor(canvasSize / 2);
|
|
25
|
+
const margin = Math.floor(canvasSize * 0.15);
|
|
26
|
+
return [
|
|
27
|
+
// Horizontal line
|
|
28
|
+
shapes.drawLine(margin, mid, canvasSize - margin, mid, color),
|
|
29
|
+
// Vertical line
|
|
30
|
+
shapes.drawLine(mid, margin, mid, canvasSize - margin, '#0000ff'),
|
|
31
|
+
// Diagonal (top-left to bottom-right)
|
|
32
|
+
shapes.drawLine(margin, margin, canvasSize - margin, canvasSize - margin, '#00aa00'),
|
|
33
|
+
// Diagonal (top-right to bottom-left)
|
|
34
|
+
shapes.drawLine(canvasSize - margin, margin, margin, canvasSize - margin, '#ff8800'),
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = { lessonLines };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-extracted from lessons.js
|
|
3
|
+
*/
|
|
4
|
+
const shapes = require('../../shapes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Lesson 13: Parallel & Intersecting Lines — Drawing parallel and intersecting lines.
|
|
8
|
+
*/
|
|
9
|
+
function lessonParallelAndIntersecting(canvasSize = 32, color = '#00bcd4') {
|
|
10
|
+
const margin = Math.floor(canvasSize * 0.1);
|
|
11
|
+
const mid = Math.floor(canvasSize / 2);
|
|
12
|
+
const offset = 4;
|
|
13
|
+
return [
|
|
14
|
+
shapes.drawLine(margin, margin, canvasSize - margin, margin, color),
|
|
15
|
+
shapes.drawLine(margin, margin + offset, canvasSize - margin, margin + offset, color),
|
|
16
|
+
shapes.drawLine(margin, margin + offset * 2, canvasSize - margin, margin + offset * 2, color),
|
|
17
|
+
shapes.drawLine(mid - offset*2, mid, mid + offset*2, canvasSize - margin, '#ff5722'),
|
|
18
|
+
shapes.drawLine(mid + offset*2, mid, mid - offset*2, canvasSize - margin, '#ff5722')
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { lessonParallelAndIntersecting };
|