Commit 85fa1fc7 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

MacroRugoCompound: limit generated aprons fields precision to 3 decimals

Showing with 5 additions and 3 deletions
+5 -3
import { round } from "../base";
import { CalculatorType } from "../compute-node"; import { CalculatorType } from "../compute-node";
import { ParamCalculability } from "../param/param-definition"; import { ParamCalculability } from "../param/param-definition";
import { Props } from "../props"; import { Props } from "../props";
...@@ -181,10 +182,11 @@ export class MacrorugoCompound extends MacroRugo implements Observer { ...@@ -181,10 +182,11 @@ export class MacrorugoCompound extends MacroRugo implements Observer {
lastBorder = 0; lastBorder = 0;
for (const xCenter of xCenters) { for (const xCenter of xCenters) {
this.addDefaultChild(); this.addDefaultChild();
this.children[this.children.length - 1].prms.ZF1.singleValue = this.children[this.children.length - 1].prms.ZF1.singleValue = round(
this.prms.ZRL.singleValue + xCenter / this.prms.BR.singleValue this.prms.ZRL.singleValue + xCenter / this.prms.BR.singleValue
* (this.prms.ZRR.singleValue - this.prms.ZRL.singleValue); * (this.prms.ZRR.singleValue - this.prms.ZRL.singleValue)
this.children[this.children.length - 1].prms.B.singleValue = (xCenter - lastBorder) * 2; , 3);
this.children[this.children.length - 1].prms.B.singleValue = round((xCenter - lastBorder) * 2, 3);
lastBorder += this.children[this.children.length - 1].prms.B.singleValue; lastBorder += this.children[this.children.length - 1].prms.B.singleValue;
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment