Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilities.Transformation - Cannot compute outward normal for vertices #4057

Closed
antonszilasi opened this issue Aug 24, 2020 · 5 comments
Closed

Comments

@antonszilasi
Copy link

antonszilasi commented Aug 24, 2020

Issue overview

Intermittently when importing a Floor js json into an OSM the import fails with the following errors and warnings seen below:

However when I try to import the same json again it will work intermittently. I have provided a google doc link to an example json where the import failed (and sometimes succeeds)

https://drive.google.com/file/d/1yq5tUGpHk7si_4fHdXDINL2RF_6XEx-w/view?usp=sharing

.... importing MaxwellRosner-2_13.json....
[utilities.geometry.intersect] <1> Face difference is self intersecting, result will not include this polygon, [[10.668, 2.43341, 0], [10.668, 5.49564, 0], [0, 5.49564, 0], [25.908, 5.49564, 0], [25.908, 2.43341, 0]]
[openstudio.model.Surface] <1> Initial area of other surface 'Face 298' 99.3688 does not equal post intersection area 52.7004
[utilities.geometry.intersect] <1> Face difference is self intersecting, result will not include this polygon, [[7.23826e-05, 2.43341, 0], [9.13367, 2.43341, 0], [9.13367, -5.49625, 0], [7.23826e-05, -5.49625, 0], [0, 1.05242e-07, 0], [7.01336, 0, 0], [7.01336, 2.43341, 0]]
[openstudio.model.Surface] <1> Initial area of other surface 'Face 312' 72.4263 does not equal post intersection area 17.0663
[openstudio.model.Surface] <1> Initial area of surface 'Surface 12' 49.6866 does not equal post intersection area 49.6862
[openstudio.model.Surface] <1> Initial area of other surface 'Face 312' 72.4263 does not equal post intersection area 72.4266
[utilities.Transformation] <1> Cannot compute outward normal for vertices
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[BOOST_ASSERT] <2> Assertion std::abs(facePoints[i].z()) < 0.001 failed on line 158 of class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > __cdecl openstudio::reorderULC(const class std::vector<class openstudio::Point3d,class std::allocator<class openstudio::Point3d> > &) in file C:\Users\jenkins\git\OpenStudio\src\utilities\geometry\Geometry.cpp.
[openstudio.model.PlanarSurface] <2> Cannot compute outward normal for vertices [[28.3494, -9.144, 3.048], [32.004, -9.144, 3.048], [28.3494, -9.144, 3.048], [28.3493, -3.64775, 3.048]], surface name = 'Surface 14'
[openstudio.model.PlanarSurface] <2> Cannot compute outward normal for vertices [[28.3494, -9.144, 3.048], [32.004, -9.144, 3.048], [28.3494, -9.144, 3.048], [28.3493, -3.64775, 3.048]], surface name = 'Surface 14

Environment

Appears both on linuix and windows, Openstudio core version is 3.0.1

@antonszilasi antonszilasi added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Aug 24, 2020
@tijcolem tijcolem added component - Geometry Editor severity - Normal Bug and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Sep 4, 2020
@tijcolem tijcolem self-assigned this Sep 4, 2020
@DavidGoldwasser
Copy link
Collaborator

Interesting (not in good way) that it is non-deterministic. Are you using the OpenStudio Application to convert FloorSpaceJS to OpenStudio, or are you using measure or stand alone script?

I did publish a measure for this as I wanted to do it outside of a GUI.
https://github.com/NREL/openstudio-model-articulation-gem/tree/develop/lib/measures/merge_floorspace_js_with_model

I run this diagnostic surface matching measure after the import, and I have extended it at I found more problematic geometry situations from imported FloorSpaceJS files. There are some FloorSpaceJS files it can't properly clean up.
https://github.com/UnmetHours/openstudio-measures/blob/master/surface_matching_diagnostic/measure.rb

If you are getting a crash on import then you won't be able to use the measure to help make valid geometry.

@macumber
Copy link
Contributor

macumber commented Sep 5, 2020

The non-deterministic aspect was partially addressed in:

https://github.com/NREL/OpenStudio/pull/4055/files#diff-8cafc578c17f0520f10020b4dfdd9757

@antonszilasi
Copy link
Author

Hi all please find link to floor js json here, somehow it got deleted

https://drive.google.com/file/d/1SbOSE4LlrYct6-Fdqa03W9XPeJfR05qt/view?usp=sharing

@jmarrec
Copy link
Collaborator

jmarrec commented Jun 8, 2021

Using a debug build of develop (the fact that you need BOOST_ASSERT means you are using a debug build)

$os_build/Products/openstudio -e "json = 'MaxwellRosner-2_13.json'; floorplan = OpenStudio::FloorplanJS.load(json); scene = floorplan.get.toThreeScene(true); rt = OpenStudio::Model::ThreeJSReverseTranslator.new; m = rt.modelFromThreeJS(scene).get"

[openstudio.model.Surface] <1> Initial area of other surface 'Face 380' 232.101 does not equal post intersection area 232.063
[openstudio.model.Surface] <1> Initial area of surface 'Face 148' 203.39 does not equal post intersection area 203.389
[openstudio.model.Surface] <1> Initial area of surface 'Face 82' 352.656 does not equal post intersection area 352.688
[openstudio.model.Surface] <1> Initial area of other surface 'Surface 20' 372.845 does not equal post intersection area 372.833
[openstudio.model.Surface] <1> Initial area of surface 'Face 128' 468.179 does not equal post intersection area 468.18

Likely fixed via #4221

(I thought we relaxed the threshold for post intersection area? 203.389 seems pretty close to 203.39)

@jmarrec
Copy link
Collaborator

jmarrec commented Jun 8, 2021

boost::optional<SurfaceIntersection> Surface_Impl::computeIntersection(Surface& otherSurface) {
double tol = 0.01; // 1 cm tolerance
double areaTol = 0.001; // 10 cm2 tolerance

I guess this could relaxed even more. Anyways, closing as fixed

@jmarrec jmarrec closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants