construction: First working macro implementation
This commit is contained in:
parent
714a5115ab
commit
3af7e4319c
4 changed files with 1820 additions and 1530 deletions
282
packages/brian/dist/browser/bundle.js
vendored
282
packages/brian/dist/browser/bundle.js
vendored
File diff suppressed because one or more lines are too long
|
@ -28,10 +28,20 @@ pattern.on('preRenderSvg', function(next) {
|
|||
this.attributes.add("viewBox", "-10 -10 600 800");
|
||||
next();
|
||||
});
|
||||
//pattern.on('preRenderSvg', function(next) {
|
||||
// this.style += 'path { stroke: green; stroke-width: 30;}';
|
||||
// next();
|
||||
//});
|
||||
pattern.macro('cof', function(next, so) {
|
||||
let points = this.points;
|
||||
points.cofStart = so.from.shiftTowards(so.to, 30);
|
||||
points.cofEnd = so.to.shiftTowards(so.from, 30);
|
||||
points.cofVia1 = so.from.shiftTowards(so.to, 50).rotate(90,points.cofStart);
|
||||
points.cofVia2 = so.to.shiftTowards(so.from, 50).rotate(-90,points.cofEnd);
|
||||
this.paths.cof = new this.path()
|
||||
.move(points.cofStart)
|
||||
.line(points.cofVia1)
|
||||
.line(points.cofVia2)
|
||||
.line(points.cofEnd)
|
||||
.attr('class', 'cut-on-fold');
|
||||
next();
|
||||
});
|
||||
//pattern.on('postRenderSvg', function(next) {
|
||||
// this.svg = this.svg.replace('green', 'yellow');
|
||||
// next();
|
||||
|
|
3042
packages/brian/package-lock.json
generated
3042
packages/brian/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -26,10 +26,10 @@ console.log('shorthand', F.utils.shorthand(part, context));
|
|||
|
||||
var decorate = function(part, context)
|
||||
{
|
||||
//macro('cof', {
|
||||
// from: points.cbNeck
|
||||
// ,to: points.cbHips
|
||||
//});
|
||||
macro('cof', {
|
||||
from: points.cbNeck
|
||||
, to: points.cbHips
|
||||
});
|
||||
}
|
||||
|
||||
if(final) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue