@eturnity/eturnity_maths
Advanced tools
Comparing version 6.31.1 to 6.32.0-EPDM-7373.0
{ | ||
"name": "@eturnity/eturnity_maths", | ||
"version": "6.31.1", | ||
"version": "6.32.0-EPDM-7373.0", | ||
"author": "Eturnity Team", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -24,3 +24,3 @@ import { | ||
} | ||
export function updateOutlineFromInclineDirection(incline, direction, outline,initialAverageHeight) { | ||
export function updateOutlineFromInclineDirection(incline, direction, outline,initialAverageHeight,isRoofOnRoof = false) { | ||
const newNormalVector = {} | ||
@@ -33,3 +33,2 @@ newNormalVector.x = | ||
let meanPoint = meanVector(outline) | ||
let minAltitude=Math.min(...outline.map(p=>p.z)) | ||
meanPoint.z=initialAverageHeight | ||
@@ -40,4 +39,12 @@ let newOutline = outline.map((p) => { | ||
//if some points are with negative altitude, we offset the whole roof | ||
const newMinAltitude = Math.min(...newOutline.map((p) => p.z)) | ||
let altitudeOffset=newMinAltitude-minAltitude | ||
let altitudeOffset | ||
let minAltitude=Math.min(...outline.map(p=>p.z)) | ||
let maxAltitude=Math.max(...outline.map(p=>p.z)) | ||
let newMinAltitude = Math.min(...newOutline.map((p) => p.z)) | ||
let newMaxAltitude = Math.max(...newOutline.map((p) => p.z)) | ||
if(isRoofOnRoof && maxAltitude!=0){ | ||
altitudeOffset=newMaxAltitude-maxAltitude | ||
}else{ | ||
altitudeOffset=newMinAltitude-minAltitude | ||
} | ||
newOutline.forEach((p) => (p.z -= altitudeOffset)) | ||
@@ -44,0 +51,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
97491
3032
2