feat(examples): Added more examples
This commit is contained in:
parent
1257469ade
commit
b1a417d123
5 changed files with 67 additions and 15 deletions
|
@ -14,9 +14,10 @@ export default {
|
|||
},
|
||||
measurements: [],
|
||||
dependencies: {
|
||||
point_attr: 'path_attr'
|
||||
//point_attr: 'path_attr'
|
||||
},
|
||||
parts: [
|
||||
/*
|
||||
'point_attr',
|
||||
'path_move',
|
||||
'path_line',
|
||||
|
@ -43,7 +44,11 @@ export default {
|
|||
'path_start',
|
||||
'path_translate',
|
||||
'path_trim',
|
||||
*/
|
||||
'plugin_bartack',
|
||||
'plugin_bartackalong',
|
||||
'plugin_bartackfractionalong'
|
||||
/*
|
||||
'plugin_buttons',
|
||||
'plugin_cutonfold',
|
||||
'plugin_dimension',
|
||||
|
@ -99,6 +104,7 @@ export default {
|
|||
'utils_splitcurve',
|
||||
'docs_overview',
|
||||
'docs_coords'
|
||||
*/
|
||||
],
|
||||
options: {
|
||||
focus: '',
|
||||
|
|
|
@ -32,6 +32,8 @@ import draftPath_translate from './path_translate'
|
|||
import draftPath_trim from './path_trim'
|
||||
// Plugins
|
||||
import draftPlugin_bartack from './plugin_bartack'
|
||||
import draftPlugin_bartackalong from './plugin_bartackalong'
|
||||
import draftPlugin_bartackfractionalong from './plugin_bartackfractionalong'
|
||||
import draftPlugin_buttons from './plugin_buttons'
|
||||
import draftPlugin_cutonfold from './plugin_cutonfold'
|
||||
import draftPlugin_dimension from './plugin_dimension'
|
||||
|
@ -128,6 +130,8 @@ let methods = {
|
|||
draftPath_translate,
|
||||
draftPath_trim,
|
||||
draftPlugin_bartack,
|
||||
draftPlugin_bartackalong,
|
||||
draftPlugin_bartackfractionalong,
|
||||
draftPlugin_buttons,
|
||||
draftPlugin_cutonfold,
|
||||
draftPlugin_dimension,
|
||||
|
|
|
@ -4,21 +4,11 @@ export default (part) => {
|
|||
let { Point, Path, points, paths, macro } = part.shorthand()
|
||||
|
||||
points.a = new Point(15, 15)
|
||||
points.b = new Point(20, 20)
|
||||
points.c = new Point(30, 20)
|
||||
points.d = new Point(35, 15)
|
||||
points.e = new Point(20, 10)
|
||||
points.f = new Point(30, 10)
|
||||
|
||||
paths.a = new Path().move(points.a).curve(points.b, points.c, points.d).setRender(false)
|
||||
|
||||
macro('bartackAlong', {
|
||||
path: paths.a
|
||||
})
|
||||
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['e', 'f']
|
||||
macro('bartack', {
|
||||
anchor: points.a,
|
||||
angle: 30,
|
||||
length: 15
|
||||
})
|
||||
|
||||
return box(part, 60, 30)
|
||||
|
|
25
packages/examples/src/plugin_bartackalong.js
Normal file
25
packages/examples/src/plugin_bartackalong.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { box } from './shared'
|
||||
|
||||
export default (part) => {
|
||||
let { Point, Path, points, paths, macro } = part.shorthand()
|
||||
|
||||
points.a = new Point(15, 15)
|
||||
points.b = new Point(20, 20)
|
||||
points.c = new Point(30, 20)
|
||||
points.d = new Point(35, 15)
|
||||
points.e = new Point(20, 10)
|
||||
points.f = new Point(30, 10)
|
||||
|
||||
paths.a = new Path().move(points.a).curve(points.b, points.c, points.d).setRender(false)
|
||||
|
||||
macro('bartackAlong', {
|
||||
path: paths.a
|
||||
})
|
||||
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['e', 'f']
|
||||
})
|
||||
|
||||
return box(part, 60, 30)
|
||||
}
|
27
packages/examples/src/plugin_bartackfractionalong.js
Normal file
27
packages/examples/src/plugin_bartackfractionalong.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { box } from './shared'
|
||||
|
||||
export default (part) => {
|
||||
let { Point, Path, points, paths, macro } = part.shorthand()
|
||||
|
||||
points.a = new Point(15, 15)
|
||||
points.b = new Point(20, 20)
|
||||
points.c = new Point(30, 20)
|
||||
points.d = new Point(35, 15)
|
||||
points.e = new Point(20, 10)
|
||||
points.f = new Point(30, 10)
|
||||
|
||||
paths.a = new Path().move(points.a).curve(points.b, points.c, points.d).setRender(false)
|
||||
|
||||
macro('bartackFractionAlong', {
|
||||
path: paths.a,
|
||||
start: 0.2,
|
||||
end: 0.8
|
||||
})
|
||||
|
||||
macro('sprinkle', {
|
||||
snippet: 'notch',
|
||||
on: ['e', 'f']
|
||||
})
|
||||
|
||||
return box(part, 60, 30)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue