geometrix 0.5.27 → 0.5.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -316,6 +316,7 @@ declare class Contour extends AContour {
|
|
|
316
316
|
setLastPoint(ix: number, iy: number): void;
|
|
317
317
|
/** @internal */
|
|
318
318
|
getLastPoint(): Point;
|
|
319
|
+
getFirstPoint(): Point;
|
|
319
320
|
addPointA(ax: number, ay: number): Contour;
|
|
320
321
|
addPointAP(aa: number, al: number): Contour;
|
|
321
322
|
addPointR(rx: number, ry: number): Contour;
|
|
@@ -615,6 +616,7 @@ declare class Transform3d {
|
|
|
615
616
|
declare function transform3d(initM?: tT3dMatrix): Transform3d;
|
|
616
617
|
|
|
617
618
|
declare function ctrRectangle(ox: number, oy: number, width: number, height: number, cornerRounded?: number): tContour;
|
|
619
|
+
declare function ctrRectRot(ox: number, oy: number, width: number, height: number, angle: number, cornerRounded?: number): tContour;
|
|
618
620
|
|
|
619
621
|
/** For cli-app and ui-app */
|
|
620
622
|
type tDependencies = Record<string, string>;
|
|
@@ -629,4 +631,4 @@ declare function version_details(appPackage: tPackage): string[];
|
|
|
629
631
|
|
|
630
632
|
declare function checkImpPages(pages: tAllPageDef): [boolean, string];
|
|
631
633
|
|
|
632
|
-
export { Contour, ContourCircle, DesignParam, DxfSeg, DxfWrite, EBVolume, EExtrude, EFormat, Figure, Line, PSeg, PType, PaxPath, Point, SegDbg, SegEnum, Segment1, Segment2, ShapePoint, Transform3d, Vector, aBFromLaLbAa, aCFromAaAb, aCFromLaLbLc, adjustCenter, adjustInit, adjustRect, adjustScale, adjustTranslate, adjustZero, arcSeg1To2, arcSeg2To1, bisector, canvas2point, canvasTranslatePolar, checkGeom, checkImpPages, circleCenter, colors, contour, contourCircle, copyLayers, createParamFile, ctrRectangle, degToRad, designParam, dxfSegArc, dxfSegCircle, dxfSegLine, dxfWriter, ffix, figure, fileBin, fileBinContent, fileMime, fileSuffix, fileTextContent, fround, gSegDbg, initGeom, initLayers, isActiveCorner, isAddPoint, isCorner, isSeg, isWithin, lbFromLaAaAb, lcFromLaLbAc, line, linePP, makeCorner, mergeFaces, oneDesignParam, orientedArc, pCheckbox, pDropdown, pNumber, pSectionSeparator, paramListToVal, parseParamFile, paxCircle, paxPath, point, point2canvas, pointMinMax, prefixLog, radToDeg, radius2canvas, rightTriLaFromLbLc, rightTriLbFromLaLc, roundZero, type tAffine, type tAllLink, type tAllPageDef, type tBVolume, type tCanvasAdjust, type tCartesian, type tContour, type tDependencies, type tDesignParamList, type tDesignParamOne, type tExtrude, type tFaces, type tGeom, type tGeomFunc, type tInherit, type tLayers, type tPackage, type tPageDef, type tParam, type tParamChanged, type tParamDef, type tParamVal, type tParamValInFile, type tPaxContour, type tPaxContourCircle, type tPaxContourPath, type tPaxSeg, type tPaxSegArc, type tPaxSegSt, type tPolar, type tPosiOrien, type tSimTime, type tSubDesign, type tSubInst, type tT3dMatrix, type tVec3, type tVec4, type tVolume, tolerance, transform3d, vector, version_details, withinHPiHPi, withinPiPi, withinZero2Pi, withinZeroPi, zeroPDef };
|
|
634
|
+
export { Contour, ContourCircle, DesignParam, DxfSeg, DxfWrite, EBVolume, EExtrude, EFormat, Figure, Line, PSeg, PType, PaxPath, Point, SegDbg, SegEnum, Segment1, Segment2, ShapePoint, Transform3d, Vector, aBFromLaLbAa, aCFromAaAb, aCFromLaLbLc, adjustCenter, adjustInit, adjustRect, adjustScale, adjustTranslate, adjustZero, arcSeg1To2, arcSeg2To1, bisector, canvas2point, canvasTranslatePolar, checkGeom, checkImpPages, circleCenter, colors, contour, contourCircle, copyLayers, createParamFile, ctrRectRot, ctrRectangle, degToRad, designParam, dxfSegArc, dxfSegCircle, dxfSegLine, dxfWriter, ffix, figure, fileBin, fileBinContent, fileMime, fileSuffix, fileTextContent, fround, gSegDbg, initGeom, initLayers, isActiveCorner, isAddPoint, isCorner, isSeg, isWithin, lbFromLaAaAb, lcFromLaLbAc, line, linePP, makeCorner, mergeFaces, oneDesignParam, orientedArc, pCheckbox, pDropdown, pNumber, pSectionSeparator, paramListToVal, parseParamFile, paxCircle, paxPath, point, point2canvas, pointMinMax, prefixLog, radToDeg, radius2canvas, rightTriLaFromLbLc, rightTriLbFromLaLc, roundZero, type tAffine, type tAllLink, type tAllPageDef, type tBVolume, type tCanvasAdjust, type tCartesian, type tContour, type tDependencies, type tDesignParamList, type tDesignParamOne, type tExtrude, type tFaces, type tGeom, type tGeomFunc, type tInherit, type tLayers, type tPackage, type tPageDef, type tParam, type tParamChanged, type tParamDef, type tParamVal, type tParamValInFile, type tPaxContour, type tPaxContourCircle, type tPaxContourPath, type tPaxSeg, type tPaxSegArc, type tPaxSegSt, type tPolar, type tPosiOrien, type tSimTime, type tSubDesign, type tSubInst, type tT3dMatrix, type tVec3, type tVec4, type tVolume, tolerance, transform3d, vector, version_details, withinHPiHPi, withinPiPi, withinZero2Pi, withinZeroPi, zeroPDef };
|
package/dist/index.js
CHANGED
|
@@ -1697,6 +1697,10 @@ var Contour = class _Contour extends AContour {
|
|
|
1697
1697
|
getLastPoint() {
|
|
1698
1698
|
return this.lastPoint;
|
|
1699
1699
|
}
|
|
1700
|
+
getFirstPoint() {
|
|
1701
|
+
const rpfirst = point(this.segments[0].px, this.segments[0].py);
|
|
1702
|
+
return rpfirst;
|
|
1703
|
+
}
|
|
1700
1704
|
addPointA(ax, ay) {
|
|
1701
1705
|
if (this.points.length > 2) {
|
|
1702
1706
|
throw `err311: contour add too much point ${ax} ${ay}`;
|
|
@@ -4051,6 +4055,10 @@ function ctrRectangle(ox, oy, width, height, cornerRounded = 0) {
|
|
|
4051
4055
|
const rCtr = contour(ox, oy).addCornerRounded(cornerRounded).addSegStrokeR(width, 0).addCornerRounded(cornerRounded).addSegStrokeR(0, height).addCornerRounded(cornerRounded).addSegStrokeR(-width, 0).addCornerRounded(cornerRounded).closeSegStroke();
|
|
4052
4056
|
return rCtr;
|
|
4053
4057
|
}
|
|
4058
|
+
function ctrRectRot(ox, oy, width, height, angle, cornerRounded = 0) {
|
|
4059
|
+
const rCtr = ctrRectangle(ox, oy, width, height, cornerRounded).rotate(ox, oy, angle);
|
|
4060
|
+
return rCtr;
|
|
4061
|
+
}
|
|
4054
4062
|
|
|
4055
4063
|
// src/version_details.ts
|
|
4056
4064
|
function version_details(appPackage) {
|
|
@@ -4129,6 +4137,7 @@ export {
|
|
|
4129
4137
|
contourCircle,
|
|
4130
4138
|
copyLayers,
|
|
4131
4139
|
createParamFile,
|
|
4140
|
+
ctrRectRot,
|
|
4132
4141
|
ctrRectangle,
|
|
4133
4142
|
degToRad,
|
|
4134
4143
|
designParam,
|