ladybug-tools / spider

:spider_web: 3D interactive analysis in your browser mostly written around the Three.js JavaScript library
http://www.ladybug.tools/spider
44 stars 15 forks source link

gbxml export issue: polyloop vertices for interior walls are sometimes in the wrong order #78

Closed chiensiTB closed 6 years ago

chiensiTB commented 6 years ago

This is a more minor bug, but does not follow the standard convention:

gbxml requires that the normal created by the rhr of the polyloop coordinates point AWAY from the first AdjacentSpaceId value. I find that sometimes this is true, but sometimes not (inconsistent).

theo-armour commented 6 years ago

@chiensiTB

gbxml requires that the normal created by the rhr of the polyloop coordinates point AWAY from the first AdjacentSpaceId value.

Thank you for pointing out this rule.

I will add it to:

http://www.ladybug.tools/spider/read-gbxml/gbxml-user-guide/gbxml-user-guide.html

BTW, this guide needs updating because it was last updated during the early stages of writing the gbXML exporter.

I will also look at the exporter and try to add the rule into the code.

theo-armour commented 6 years ago

@chiensiTB

Question:

Are you talking about PlanarGometry here? If so, isn't there just a single element of geometry between two interior spaces? And if that is true then the normal will have to face IN some spaces and OUT in the adjacent space. No? See image below with normals drawn for all interior spaces.

image

chiensiTB commented 6 years ago

There is only a single element, yes. But in energy models, it is important to understand how the constructions are applied. By convention, you use the normal direction and adjacent space ids to set a "mini" reference frame if you will.

The direction of the normal is arbitrary, which I think is what you are saying. But the adjacent space id elements are not, as they are keyed off the normal direction.

Construction definitions in turn, the way the layers are oriented, are defined by the order of the adjacent space ids.

theo-armour commented 6 years ago

@chiensiTB

Thank you for the clarification.

But the adjacent space id elements are not, as they are keyed off the normal direction.

A couple of thoughts in response:

A convention or clarification

According to Wikipedia:

A normal to a surface does not have a unique direction; the vector pointing in the opposite direction of a surface normal is also a surface normal.

Wikipedia continues:

For an oriented surface, the surface normal is usually determined by the right-hand rule.

In the case of interior walls, as I think we agree, the orientation is arbitrary and the right hand rule is difficult to invoke. Therefore what is needed is a convention. I suggest that if a directed normal is depicted in a model as being in a particular Space then the first AdjacentSpaceId is listed as the one on the side of the surface opposite the directed vector.

In the case of ceilings the directed normal should point up and on interior floors should point down. Generally, their directed vectors would match the directed vectors of roofs and slabs on grade.

Verification

The more important question is how can we verify if things are cool?

Here are two methods:

Will the gbXML file open in your browser?

Your browser will either open the file or provide a helpful error message as to the location and cause of an error in the XML syntax.

Will the gbXML file open in Open Studio?

Does the gbXML file import without error? Does the model display as anticipated in the geometry view

Can you think of other ways of testing gbXML files that can be carried out by normal folks?

theo-armour commented 6 years ago

@chiensiTB

create exportable buildings r1.10

R1.10