Commit b8f6a1b5 authored by Grand Francois's avatar Grand Francois
Browse files

fix: set simple/compound ramp width tolerance to 1 cm

refs #344
Showing with 6 additions and 4 deletions
+6 -4
......@@ -105,11 +105,12 @@ export class MacroRugo extends FishPass {
)
) {
const ax: number = this.prms.PBD.v / Math.sqrt(this.prms.C.v);
if (this.prms.B.v < ax - 0.001) { // B < ax, with a little tolerance
const tol = 0.01; // tolérance avant avertissement (1 cm)
if (this.prms.B.v < ax - tol) { // B < ax, with a little tolerance
const m = new Message(MessageCode.WARNING_RAMP_WIDTH_LOWER_THAN_PATTERN_WIDTH);
m.extraVar.pattern = ax;
r.resultElement.log.add(m);
} else if (this.prms.B.v % (ax / 2) > 0.001 && this.prms.B.v % (ax / 2) < ax / 2 - 0.001) {
} else if (this.prms.B.v % (ax / 2) > tol && this.prms.B.v % (ax / 2) < ax / 2 - tol) {
const m = new Message(MessageCode.WARNING_RAMP_WIDTH_NOT_MULTIPLE_OF_HALF_PATTERN_WIDTH);
m.extraVar.halfPattern = ax / 2;
m.extraVar.lower = Math.floor(this.prms.B.v / ax * 2) * (ax / 2);
......
......@@ -99,11 +99,12 @@ export class MacrorugoCompound extends MacroRugo implements Observer {
this.result.resultElement.values.LIncl = (this.prms.ZRL.v - this.prms.ZRR.v) / this.prms.BR.v;
// La largeur de la rampe inclinée est-elle adéquate par rapport à la largeur de motif ax ?
const ax: number = this.prms.PBD.v / Math.sqrt(this.prms.C.v);
if (this.prms.BR.v - ax < -0.001) { // BR < ax, with a little tolerance
const tol = 0.01; // tolérance avant avertissement (1 cm)
if (this.prms.BR.v - ax < -tol) { // BR < ax, with a little tolerance
const m = new Message(MessageCode.WARNING_RAMP_WIDTH_LOWER_THAN_PATTERN_WIDTH);
m.extraVar.pattern = ax;
this._result.resultElement.log.add(m);
} else if (this.prms.BR.v % (ax / 2) > 0.001 && this.prms.BR.v % (ax / 2) < ax / 2 - 0.001) {
} else if (this.prms.BR.v % (ax / 2) > tol && this.prms.BR.v % (ax / 2) < ax / 2 - tol) {
const m = new Message(MessageCode.WARNING_RAMP_WIDTH_NOT_MULTIPLE_OF_HALF_PATTERN_WIDTH);
m.extraVar.halfPattern = ax / 2;
m.extraVar.lower = Math.floor(this.prms.BR.v / ax * 2) * (ax / 2);
......
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