mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Some changes after #1155
This commit is contained in:
@@ -402,7 +402,7 @@ int main(int argc, char** argv) {
|
||||
("site-local-placement",
|
||||
"Place elements locally in the IfcSite coordinate system, instead of placing "
|
||||
"them in the IFC global coords. Applicable for OBJ and DAE output.")
|
||||
("use-z-up", "Z UP. default Y UP,Applicable for OBJ output.")
|
||||
("y-up", "Change the 'up' axis to positive Y, default is Z UP,Applicable for OBJ output.")
|
||||
("building-local-placement",
|
||||
"Similar to --site-local-placement, but placing elements in locally in the parent IfcBuilding coord system")
|
||||
("precision", po::value<short>(&precision)->default_value(SerializerSettings::DEFAULT_PRECISION),
|
||||
@@ -468,7 +468,7 @@ int main(int argc, char** argv) {
|
||||
const bool use_material_names = vmap.count("use-material-names") != 0;
|
||||
const bool use_element_types = vmap.count("use-element-types") != 0;
|
||||
const bool use_element_hierarchy = vmap.count("use-element-hierarchy") != 0;
|
||||
const bool use_z_up = vmap.count("use-z-up") != 0;
|
||||
const bool use_y_up = vmap.count("y-up") != 0;
|
||||
const bool no_normals = vmap.count("no-normals") != 0;
|
||||
const bool center_model = vmap.count("center-model") != 0;
|
||||
const bool center_model_geometry = vmap.count("center-model-geometry") != 0;
|
||||
@@ -742,7 +742,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
settings.set(SerializerSettings::USE_ELEMENT_NAMES, use_element_names);
|
||||
settings.set(SerializerSettings::USE_ELEMENT_GUIDS, use_element_guids);
|
||||
settings.set(SerializerSettings::USE_Z_UP, use_z_up);
|
||||
settings.set(SerializerSettings::USE_Y_UP, use_y_up);
|
||||
settings.set(SerializerSettings::USE_ELEMENT_STEPIDS, use_element_stepids);
|
||||
settings.set(SerializerSettings::USE_MATERIAL_NAMES, use_material_names);
|
||||
settings.set(SerializerSettings::USE_ELEMENT_TYPES, use_element_types);
|
||||
|
||||
@@ -53,9 +53,9 @@ public:
|
||||
/// Use step ids for naming elements.
|
||||
/// Applicable for OBJ, DAE, and SVG output.
|
||||
USE_ELEMENT_STEPIDS = 1 << (IfcGeom::IteratorSettings::NUM_SETTINGS + 6),
|
||||
/// Use step Z UP .
|
||||
/// Use Y UP .
|
||||
/// Applicable for OBJ output.
|
||||
USE_Z_UP = 1 << (IfcGeom::IteratorSettings::NUM_SETTINGS + 7),
|
||||
USE_Y_UP = 1 << (IfcGeom::IteratorSettings::NUM_SETTINGS + 7),
|
||||
/// Number of different setting flags.
|
||||
NUM_SETTINGS = 7
|
||||
};
|
||||
|
||||
@@ -88,11 +88,8 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<real_t>*
|
||||
{
|
||||
obj_stream << "g " << object_id(o) << "\n";
|
||||
obj_stream << "s 1" << "\n";
|
||||
bool isyup = true;
|
||||
if (settings().get(SerializerSettings::USE_Z_UP) ){ //settings().get(SerializerSettings::USE_Z_UP)
|
||||
isyup = false;
|
||||
}
|
||||
|
||||
const bool isyup = settings().get(SerializerSettings::USE_Y_UP);
|
||||
|
||||
const IfcGeom::Representation::Triangulation<real_t>& mesh = o->geometry();
|
||||
|
||||
const int vcount = (int)mesh.verts().size() / 3;
|
||||
@@ -101,10 +98,10 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<real_t>*
|
||||
const real_t y = *(it++);
|
||||
const real_t z = *(it++);
|
||||
|
||||
if(isyup){
|
||||
if (isyup) {
|
||||
obj_stream << "v " << x << " " << z << " " << -y << "\n";
|
||||
} else {
|
||||
obj_stream << "v " << x << " " << y << " " << z << "\n";
|
||||
}else{
|
||||
obj_stream << "v " << -x << " " << z << " " << y << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user