New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eturnity/eturnity_maths

Package Overview
Dependencies
Maintainers
5
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eturnity/eturnity_maths - npm Package Compare versions

Comparing version 6.42.1-EPDM-7379.1 to 6.42.1-EPDM-7379.2

4

package.json
{
"name": "@eturnity/eturnity_maths",
"version": "6.42.1-EPDM-7379.1",
"version": "6.42.1-EPDM-7379.2",
"author": "Eturnity Team",

@@ -30,2 +30,2 @@ "main": "src/index.js",

"description": ""
}
}
import {
meanVector,
substractVector,
multiplyVector
multiplyVector,
addVector
} from '../../vector'

@@ -12,3 +13,7 @@ import {

calculateArea,
getConcaveOutline
getConcaveOutline,
normalizedVectorTowardInsideAngle,
normalizeVector,
isAlmostSamePoint2D,
getDistanceBetweenPoints
} from '../../geometry'

@@ -60,2 +65,6 @@ import { maximumGapLimit } from '../../config'

}
if(isAlmostSamePoint2D(polygon.outline[0],polygon.outline[polygon.outline.length-1],10)){
polygon.outline.pop()
}
polygon.outline = calculateValidOutlineFromPolygon(polygon.outline)
const {

@@ -93,2 +102,29 @@ projectedOutline,

}
export function calculateValidOutlineFromPolygon(outline){
//check if two nodes are same
const nodeIndexToSplit=[]
for(let k=0;k<outline.length-1;k++){
for(let i=k+1;i<outline.length;i++){
if(isAlmostSamePoint2D(outline[k],outline[i],100)){
nodeIndexToSplit.push([k,i])
}
}
}
for(let coupleToSplit of nodeIndexToSplit){
const A = outline[(coupleToSplit[0]-1+outline.length)%outline.length]
const B = outline[coupleToSplit[0]]
const C = outline[(coupleToSplit[0]+1)%outline.length]
let v = normalizedVectorTowardInsideAngle(A,B,C)
// let v0=normalizeVector(substractVector())
outline[coupleToSplit[0]] = {
...addVector(multiplyVector(-50,v),B),
z:outline[coupleToSplit[0]].z
}
outline[coupleToSplit[1]] = {
...addVector(multiplyVector(50,v),B),
z:outline[coupleToSplit[1]].z
}
}
return outline
}

@@ -95,0 +131,0 @@ export function calculateBestFittingPlanePolygon(fullOutline) {

@@ -64,3 +64,2 @@ import { PlanarFaceTree } from 'planar-face-discovery'

) {
//if(isClosedContructionPolyline){
constructionPolyline.outline.forEach((p) => {

@@ -86,3 +85,2 @@ let supportRoof = roofs.find((roof) => isInsidePolygon(p, roof.outline))

//3. generate all edges not cut, those cut and those from construction polyline
const edgeList = getEdgeList(

@@ -398,3 +396,3 @@ nodeList,

if (cycleTree.cycle.length) {
//cycles.push(cycleTree.cycle)
cycles.push(cycleTree.cycle)
}

@@ -422,3 +420,2 @@ return cycles

}
let outlines = cycles

@@ -425,0 +422,0 @@ .map((cycle) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc