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

citygml-validate-shell

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

citygml-validate-shell - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

34

index.js

@@ -337,2 +337,3 @@ // Note: QIE paper states that only LOD1–3 geometries are to be tested,

var polygonPoints = [];
var polygonWindings = [];

@@ -351,2 +352,8 @@ _.each(shell, function(polygonXML) {

_.each(polygonPoints, function(pPoints) {
var points2d = points3dto2d(pPoints);
var poly = polygonjs(points2d.points);
// Find winding
polygonWindings.push(poly.winding());
// Find top-most point

@@ -398,9 +405,9 @@ _.each(pPoints, function(point) {

var checkPoints2d = points3dto2d(outerPolygon[0], false);
var checkPolygon = polygonjs(checkPoints2d.points);
var checkWinding = checkPolygon.winding();
// If normal has a negative Z then fail as shallowest (top-most) polygon
// will always have a positive Z normal
if (outerPolygonNormal[2] < 0) {
var checkPoints2d = points3dto2d(outerPolygon[0], false);
var checkPolygon = polygonjs(checkPoints2d.points);
var checkWinding = checkPolygon.winding();
var insideOut = true;

@@ -450,4 +457,21 @@

// All edges match up, now check windings match
// It's possible that a polygon can have matched edges yet still be pointing
// the wrong way. Eg. A flipped polygon would behave this way.
// We can't just check winding *or* edges as it's also possible for all
// polygons to be wound correctly yet not share edges properly.
if (flipped.length === 0) {
callback(null);
var wrongWinding = false;
_.each(polygonWindings, function(winding) {
if (winding !== checkWinding) {
wrongWinding = true;
}
});
if (!wrongWinding) {
callback(null);
} else {
callback(null, [new Error("GE_S_POLYGON_WRONG_ORIENTATION: When an exterior polygon is viewed from outside the shell the points must be ordered counterclockwise"), polygonWindings]);
}
} else {

@@ -454,0 +478,0 @@ callback(null, [new Error("GE_S_POLYGON_WRONG_ORIENTATION: When an exterior polygon is viewed from outside the shell the points must be ordered counterclockwise"), flipped]);

2

package.json
{
"name": "citygml-validate-shell",
"version": "0.1.14",
"version": "0.1.15",
"description": "Validate a CityGML shell against the QIE suite",

@@ -5,0 +5,0 @@ "main": "index.js",

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