1
0
Fork 0

feat(examples): Added more examples

This commit is contained in:
Joost De Cock 2021-04-16 19:21:36 +02:00
parent 1257469ade
commit b1a417d123
5 changed files with 67 additions and 15 deletions

View file

@ -14,9 +14,10 @@ export default {
}, },
measurements: [], measurements: [],
dependencies: { dependencies: {
point_attr: 'path_attr' //point_attr: 'path_attr'
}, },
parts: [ parts: [
/*
'point_attr', 'point_attr',
'path_move', 'path_move',
'path_line', 'path_line',
@ -43,7 +44,11 @@ export default {
'path_start', 'path_start',
'path_translate', 'path_translate',
'path_trim', 'path_trim',
*/
'plugin_bartack', 'plugin_bartack',
'plugin_bartackalong',
'plugin_bartackfractionalong'
/*
'plugin_buttons', 'plugin_buttons',
'plugin_cutonfold', 'plugin_cutonfold',
'plugin_dimension', 'plugin_dimension',
@ -99,6 +104,7 @@ export default {
'utils_splitcurve', 'utils_splitcurve',
'docs_overview', 'docs_overview',
'docs_coords' 'docs_coords'
*/
], ],
options: { options: {
focus: '', focus: '',

View file

@ -32,6 +32,8 @@ import draftPath_translate from './path_translate'
import draftPath_trim from './path_trim' import draftPath_trim from './path_trim'
// Plugins // Plugins
import draftPlugin_bartack from './plugin_bartack' 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_buttons from './plugin_buttons'
import draftPlugin_cutonfold from './plugin_cutonfold' import draftPlugin_cutonfold from './plugin_cutonfold'
import draftPlugin_dimension from './plugin_dimension' import draftPlugin_dimension from './plugin_dimension'
@ -128,6 +130,8 @@ let methods = {
draftPath_translate, draftPath_translate,
draftPath_trim, draftPath_trim,
draftPlugin_bartack, draftPlugin_bartack,
draftPlugin_bartackalong,
draftPlugin_bartackfractionalong,
draftPlugin_buttons, draftPlugin_buttons,
draftPlugin_cutonfold, draftPlugin_cutonfold,
draftPlugin_dimension, draftPlugin_dimension,

View file

@ -4,21 +4,11 @@ export default (part) => {
let { Point, Path, points, paths, macro } = part.shorthand() let { Point, Path, points, paths, macro } = part.shorthand()
points.a = new Point(15, 15) 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('bartack', {
anchor: points.a,
macro('bartackAlong', { angle: 30,
path: paths.a length: 15
})
macro('sprinkle', {
snippet: 'notch',
on: ['e', 'f']
}) })
return box(part, 60, 30) return box(part, 60, 30)

View 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)
}

View 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)
}