brepjs-sheetmetal 0.4.3 → 0.4.4

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.
@@ -2944,29 +2944,13 @@ function buildWedge$1(axisOrigin, thetaDeg, outerR, width, direction) {
2944
2944
  }
2945
2945
  /** The flange flat, built lying along +X past the bend, then folded to angle θ. */
2946
2946
  function buildFlangeFlat(axisOrigin, thetaDeg, width, thickness, length, direction) {
2947
- if (direction === "up") {
2948
- const flat = (0, brepjs.box)(length, width, thickness);
2949
- const positioned = (0, brepjs.translate)(flat, [
2950
- axisOrigin[0],
2951
- axisOrigin[1],
2952
- 0
2953
- ]);
2954
- return (0, brepjs.rotate)(positioned, -thetaDeg, {
2955
- at: axisOrigin,
2956
- axis: [
2957
- 0,
2958
- 1,
2959
- 0
2960
- ]
2961
- });
2962
- }
2963
2947
  const flat = (0, brepjs.box)(length, width, thickness);
2964
2948
  const positioned = (0, brepjs.translate)(flat, [
2965
2949
  axisOrigin[0],
2966
2950
  axisOrigin[1],
2967
- -thickness
2951
+ 0
2968
2952
  ]);
2969
- return (0, brepjs.rotate)(positioned, thetaDeg, {
2953
+ return (0, brepjs.rotate)(positioned, (direction === "up" ? -1 : 1) * thetaDeg, {
2970
2954
  at: axisOrigin,
2971
2955
  axis: [
2972
2956
  0,
@@ -2943,29 +2943,13 @@ function buildWedge$1(axisOrigin, thetaDeg, outerR, width, direction) {
2943
2943
  }
2944
2944
  /** The flange flat, built lying along +X past the bend, then folded to angle θ. */
2945
2945
  function buildFlangeFlat(axisOrigin, thetaDeg, width, thickness, length, direction) {
2946
- if (direction === "up") {
2947
- const flat = box(length, width, thickness);
2948
- const positioned = translate(flat, [
2949
- axisOrigin[0],
2950
- axisOrigin[1],
2951
- 0
2952
- ]);
2953
- return rotate(positioned, -thetaDeg, {
2954
- at: axisOrigin,
2955
- axis: [
2956
- 0,
2957
- 1,
2958
- 0
2959
- ]
2960
- });
2961
- }
2962
2946
  const flat = box(length, width, thickness);
2963
2947
  const positioned = translate(flat, [
2964
2948
  axisOrigin[0],
2965
2949
  axisOrigin[1],
2966
- -thickness
2950
+ 0
2967
2951
  ]);
2968
- return rotate(positioned, thetaDeg, {
2952
+ return rotate(positioned, (direction === "up" ? -1 : 1) * thetaDeg, {
2969
2953
  at: axisOrigin,
2970
2954
  axis: [
2971
2955
  0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs-sheetmetal",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Sheet-metal CAD domain for brepjs — flange authoring, auto-miter, fold/unfold flat patterns",
5
5
  "keywords": [
6
6
  "sheet-metal",