mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Use model-offset in IfcGeom::Kernel and add model-rotation
This commit is contained in:
@@ -212,11 +212,6 @@ void ColladaSerializer::ColladaExporter::ColladaScene::add(
|
||||
{ (double)posmatrix[2], (double)posmatrix[5], (double)posmatrix[8], (double)posmatrix[11] },
|
||||
{ 0, 0, 0, 1 }
|
||||
};
|
||||
|
||||
/// @todo: TFK: Rather than applying this offset to all leafs (which might be undesirable) should this offset be applied to a node higher up in the hierarchy?
|
||||
matrix_array[0][3] += serializer->settings().offset[0];
|
||||
matrix_array[1][3] += serializer->settings().offset[1];
|
||||
matrix_array[2][3] += serializer->settings().offset[2];
|
||||
|
||||
delete relative_trsf;
|
||||
|
||||
|
||||
@@ -55,13 +55,7 @@ public:
|
||||
};
|
||||
|
||||
SerializerSettings()
|
||||
: precision(DEFAULT_PRECISION)
|
||||
{
|
||||
memset(offset, 0, sizeof(offset));
|
||||
}
|
||||
|
||||
/// Optional offset that is applied to serialized objects, (0,0,0) by default.
|
||||
double offset[3];
|
||||
: precision(DEFAULT_PRECISION) { }
|
||||
|
||||
/// Sets the precision used to format floating-point values, 15 by default.
|
||||
/// Use a negative value to use the system's default precision (should be 6 typically).
|
||||
|
||||
@@ -93,9 +93,9 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<real_t>*
|
||||
|
||||
const int vcount = (int)mesh.verts().size() / 3;
|
||||
for ( std::vector<real_t>::const_iterator it = mesh.verts().begin(); it != mesh.verts().end(); ) {
|
||||
const real_t x = *(it++) + (real_t)settings().offset[0];
|
||||
const real_t y = *(it++) + (real_t)settings().offset[1];
|
||||
const real_t z = *(it++) + (real_t)settings().offset[2];
|
||||
const real_t x = *(it++);
|
||||
const real_t y = *(it++);
|
||||
const real_t z = *(it++);
|
||||
obj_stream << "v " << x << " " << y << " " << z << "\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user