-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(examples): overhauled module-design example for more clarity,
better structure, and more idiomatic v2
- Loading branch information
1 parent
924047b
commit d18a915
Showing
3 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const { cube } = require('@jscad/modeling').primitives | ||
const { cuboid } = require('@jscad/modeling').primitives | ||
|
||
const mountPlate = (length) => { | ||
return cube({ size: [length, 1, 1] }) | ||
return cuboid({ size: [length, 10, 1] }) | ||
} | ||
|
||
module.exports = mountPlate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
const { sphere } = require('@jscad/modeling').primitives | ||
const color = require('@jscad/modeling').color.color | ||
|
||
const sphereShape = (radius) => { | ||
return sphere({ radius }) | ||
return color([1, 0, 0, 1], sphere({ radius })) | ||
} | ||
|
||
module.exports = sphereShape |