API naming
This commit is contained in:
parent
ba12643c37
commit
15c7381673
4 changed files with 7 additions and 7 deletions
|
@ -16,7 +16,7 @@ export : define [SetupBuilders args] : begin
|
|||
g1.include item
|
||||
set g1.contours : g1.contours.map CurveUtil.convertContourToCubic
|
||||
local c1 : TypoGeom.Boolean.combine operator [CurveUtil.convertShapeToArcs g.contours] [CurveUtil.convertShapeToArcs g1.contours] TypoGeom.Boolean.PolyFillType.pftNonZero TypoGeom.Boolean.PolyFillType.pftNonZero 16384
|
||||
local ctx : new CurveUtil.ArcFlattener
|
||||
local ctx : new CurveUtil.BezToContoursSink
|
||||
TypoGeom.transferBezArcShape c1 ctx
|
||||
set g.contours ctx.contours
|
||||
this.includeGlyph g
|
||||
|
|
|
@ -166,7 +166,7 @@ export : define [SetupBuilders args] : begin
|
|||
|
||||
local {.lhs lhs .rhs rhs} : s.expand [fallback s.contrast Contrast]
|
||||
if closed : then
|
||||
local g : new CurveUtil.ArcFlattener
|
||||
local g : new CurveUtil.BezToContoursSink
|
||||
SpiroJs.spiroToBezierOnContext [lhs.slice 0 (-1)] true g QUAD PRECISION
|
||||
local lhsContour g.contours.0
|
||||
set g.contours {}
|
||||
|
@ -174,7 +174,7 @@ export : define [SetupBuilders args] : begin
|
|||
local rhsContour g.contours.0
|
||||
set g.contours {[lhsContour.concat rhsContour]}
|
||||
: else : begin
|
||||
local g : new CurveUtil.ArcFlattener
|
||||
local g : new CurveUtil.BezToContoursSink
|
||||
lhs.0.type = rhs.0.type = lhs.(lhs.length - 1).type = rhs.(rhs.length - 1).type = 'corner'
|
||||
SpiroJs.spiroToBezierOnContext [lhs.concat : rhs.reverse] true g QUAD PRECISION
|
||||
|
||||
|
@ -185,7 +185,7 @@ export : define [SetupBuilders args] : begin
|
|||
return g
|
||||
|
||||
define [spiro-outline] : let [k : {}.slice.call arguments 0] : lambda [dontinc] : begin
|
||||
local g : new CurveUtil.ArcFlattener (this.gizmo || globalTransform)
|
||||
local g : new CurveUtil.BezToContoursSink (this.gizmo || globalTransform)
|
||||
local {.knots knots .closed closed .lastafs lastafs} : prepareSpiroKnots k g
|
||||
SpiroJs.spiroToBezierOnContext knots closed g QUAD PRECISION
|
||||
foreach af [items-of lastafs] : if af : af.call g
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$$include '../meta/macros.ptl'
|
||||
|
||||
import [OffsetCurve ArcFlattener] from '../support/curve-util'
|
||||
import [OffsetCurve BezToContoursSink] from '../support/curve-util'
|
||||
import [mix linreg clamp fallback] from '../support/utils'
|
||||
import [designParameters] from '../meta/aesthetics'
|
||||
import [Arcs Quadify transferGenericShapeAsBezier] from "typo-geom"
|
||||
|
@ -229,7 +229,7 @@ glyph-block Overmarks : begin
|
|||
define inner : new OffsetCurve bone (+hs) HVContrast
|
||||
define outer : new Arcs.Reverted : new OffsetCurve bone (-hs) HVContrast
|
||||
|
||||
define cs : new ArcFlattener
|
||||
define cs : new BezToContoursSink
|
||||
transferGenericShapeAsBezier {{inner outer}} cs (1 / 4)
|
||||
include cs
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ function convertShapeToArcs(shape) {
|
|||
exports.convertContourToCubic = convertContourToCubic;
|
||||
exports.convertShapeToArcs = convertShapeToArcs;
|
||||
|
||||
exports.ArcFlattener = class ArcFlattener {
|
||||
exports.BezToContoursSink = class BezToContoursSink {
|
||||
constructor(gizmo) {
|
||||
this.gizmo = gizmo || Transform.Id();
|
||||
this.contours = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue