geometrix 0.5.27 → 0.5.29

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 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,
package/package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "name": "geometrix",
3
- "version": "0.5.27",
3
+ "version": "0.5.29",
4
4
  "description": "The 2D geometry engine of the parametrix",
5
+ "type": "module",
5
6
  "private": false,
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "!dist/**/*.map",
16
+ "!dist/**/*.test.*",
17
+ "!dist/**/*.spec.*"
18
+ ],
6
19
  "repository": {
7
20
  "type": "git",
8
21
  "url": "git+https://github.com/charlyoleg2/parametrix.git"
@@ -44,7 +57,7 @@
44
57
  "@zip.js/zip.js": "^2.7.40"
45
58
  },
46
59
  "devDependencies": {
47
- "@types/node": "^20.11.30",
60
+ "@types/node": "^20.12.2",
48
61
  "@typescript-eslint/eslint-plugin": "^7.0.1",
49
62
  "@typescript-eslint/parser": "^7.0.1",
50
63
  "eslint": "^8.57.0",
@@ -56,18 +69,12 @@
56
69
  "typescript": "^5.4.3",
57
70
  "vitest": "^1.4.0"
58
71
  },
59
- "exports": {
60
- ".": {
61
- "types": "./dist/index.d.ts",
62
- "default": "./dist/index.js"
63
- }
64
- },
65
- "files": [
66
- "dist",
67
- "!dist/**/*.map",
68
- "!dist/**/*.test.*",
69
- "!dist/**/*.spec.*"
70
- ],
71
- "types": "./dist/index.d.ts",
72
- "type": "module"
72
+ "prettier": {
73
+ "useTabs": true,
74
+ "singleQuote": true,
75
+ "trailingComma": "none",
76
+ "printWidth": 100,
77
+ "plugins": [],
78
+ "overrides": []
79
+ }
73
80
  }