From d78c9171db598ef4913e394722e8dc8bee82c451 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Thu, 6 Sep 2018 12:23:07 -0400 Subject: [PATCH 1/2] Misc. typos Found via `codespell -q 3` --- src/examples/IfcOpenHouse.cpp | 8 ++++---- src/ifcconvert/IfcConvert.cpp | 2 +- src/ifcconvert/XmlSerializer.cpp | 2 +- src/ifcgeom/IfcGeom.h | 4 ++-- src/ifcgeom/IfcGeomFunctions.cpp | 6 +++--- src/ifcgeom/IfcGeomIterator.h | 4 ++-- src/ifcgeom/IfcGeomWires.cpp | 2 +- src/ifcmax/IfcMax.cpp | 2 +- src/ifcopenshell-python/ifcopenshell/entity_instance.py | 2 +- src/ifcparse/IfcWrite.h | 2 +- win/build-deps.cmd | 2 +- win/readme.md | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/examples/IfcOpenHouse.cpp b/src/examples/IfcOpenHouse.cpp index 90e4195c8b..083b0e25c6 100644 --- a/src/examples/IfcOpenHouse.cpp +++ b/src/examples/IfcOpenHouse.cpp @@ -240,7 +240,7 @@ int main() { file.addBuildingProduct(west_wall); // The west wall is assigned an opening element we created for the south wall, opening elements are - // not shared accross building elements, even if they share the same representation. Hence, the east + // not shared across building elements, even if they share the same representation. Hence, the east // wall will not feature this opening. // NB: an Opening Element can only be used to create a single void within a single Element, as per: // http://www.buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcproductextension/lexical/ifcfeatureelementsubtraction.htm @@ -412,7 +412,7 @@ int main() { // Therefore we will construct the window as a decomposition of beams and a plate, in which // only the plate will have a transparent material assigned. - // The window frame will consists of four seperate beams. + // The window frame will consists of four separate beams. // AutoCAD Architecture will create an internal window type for the IfcWindow created. // Therefore the OverallWidth and OverallHeight of the window attributes will need to // match the bounding box of the representation. Furthermore, the window placement needs @@ -463,10 +463,10 @@ int main() { ); file.addBuildingProduct(window); - // Initalize a list of parts for the window to be composed of + // Initialize a list of parts for the window to be composed of IfcSchema::IfcObjectDefinition::list::ptr window_parts(new IfcTemplatedEntityList()); - // The placements for the beams are not shared accross the different windows because every + // The placements for the beams are not shared across the different windows because every // beam is placed relative to its parent window entity. IfcSchema::IfcLocalPlacement::list::ptr frame_placements (new IfcTemplatedEntityList()); frame_placements->push(file.addLocalPlacement(storey_placement, 930,45)); diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index d4203c2e4a..cd9fba7f75 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -257,7 +257,7 @@ int main(int argc, char** argv) "Not guaranteed to work properly if used with --weld-vertices.") ("filter-file", po::value(&filter_filename), "Specifies a filter file that describes the used filtering criteria. Supported formats " - "are '--include=arg GlobalId ...' and 'include arg GlobalId ...'. Spaces and tabs can be used as delimeters." + "are '--include=arg GlobalId ...' and 'include arg GlobalId ...'. Spaces and tabs can be used as delimiters." "Multiple filters of same type with different values can be inserted on their own lines. " "See --include, --include+, --exclude, and --exclude+ for more details."); diff --git a/src/ifcconvert/XmlSerializer.cpp b/src/ifcconvert/XmlSerializer.cpp index e88ce0405f..6bb3f54a54 100644 --- a/src/ifcconvert/XmlSerializer.cpp +++ b/src/ifcconvert/XmlSerializer.cpp @@ -464,7 +464,7 @@ void XmlSerializer::finalize() { // Layer assignments. IfcPresentationLayerAssignments don't have GUIDs (only optional Identifier) // so use names as the IDs and only insert those with unique names. In case of possible duplicate names/IDs - // the first IfcPresentationLayerAssignment occurence takes precedence. + // the first IfcPresentationLayerAssignment occurrence takes precedence. std::set layer_names; IfcPresentationLayerAssignment::list::ptr layer_assignments = file->entitiesByType(); for (IfcPresentationLayerAssignment::list::it it = layer_assignments->begin(); it != layer_assignments->end(); ++it) { diff --git a/src/ifcgeom/IfcGeom.h b/src/ifcgeom/IfcGeom.h index 5ce6a8801d..d6472287cc 100644 --- a/src/ifcgeom/IfcGeom.h +++ b/src/ifcgeom/IfcGeom.h @@ -139,12 +139,12 @@ public: // Default: 0.001m / 1mm GV_DEFLECTION_TOLERANCE, // Specifies the tolerance of the wire builder, most notably for trimmed curves - // Defailt: 0.0001m / 0.1mm + // Default: 0.0001m / 0.1mm GV_WIRE_CREATION_TOLERANCE, // Specifies the minimal area of a face to be included in an IfcConnectedFaceset // Read-only GV_MINIMAL_FACE_AREA, - // Specifies the treshold distance under which cartesian points are deemed equal + // Specifies the threshold distance under which cartesian points are deemed equal // Default: 0.00001m / 0.01mm GV_POINT_EQUALITY_TOLERANCE, // Specifies maximum number of faces for a shell to be sewed. Sewing shells diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 5630f0bb8d..7ed8ddc228 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -675,10 +675,10 @@ bool IfcGeom::Kernel::convert_curve_to_wire(const Handle(Geom_Curve)& curve, Top if (e.GetMessageString() && strlen(e.GetMessageString())) { Logger::Error(e.GetMessageString()); } else { - Logger::Error("Unknown error convering curve to wire"); + Logger::Error("Unknown error converting curve to wire"); } } catch (...) { - Logger::Error("Unknown error convering curve to wire"); + Logger::Error("Unknown error converting curve to wire"); } return false; } @@ -2539,7 +2539,7 @@ bool IfcGeom::Kernel::project(const Handle_Geom_Surface& srf, const TopoDS_Shape return false; } - // Add a little bit of resulution so that the median is shifted towards the mass + // Add a little bit of resolution so that the median is shifted towards the mass // of the curve. This helps to find the parameter ordering for conic surfaces. for (TopExp_Explorer exp(shp, TopAbs_EDGE); exp.More(); exp.Next(), ++vertex_count) { const TopoDS_Edge& e = TopoDS::Edge(exp.Current()); diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h index 9814304e63..e6898df684 100644 --- a/src/ifcgeom/IfcGeomIterator.h +++ b/src/ifcgeom/IfcGeomIterator.h @@ -349,7 +349,7 @@ namespace IfcGeom { // Move to the next IfcRepresentation void _nextShape() { // In order to conserve memory and reduce cache insertion times, the cache is - // cleared after an arbitary number of processed representations. This has been + // cleared after an arbitrary number of processed representations. This has been // benchmarked extensively: https://github.com/IfcOpenShell/IfcOpenShell/pull/47 static const int clear_interval = 64; if (done % clear_interval == clear_interval - 1) { @@ -437,7 +437,7 @@ namespace IfcGeom { IfcSchema::IfcRepresentation* representation_mapped_to = kernel.representation_mapped_to(representation); if (representation_mapped_to) { - // Check if this represenation has (or will be) processed as part its mapped representation + // Check if this representation has (or will be) processed as part its mapped representation representation_processed_as_mapped_item = ok_mapped_representations->contains(representation_mapped_to) || reuse_ok_(kernel.products_represented_by(representation_mapped_to)); } diff --git a/src/ifcgeom/IfcGeomWires.cpp b/src/ifcgeom/IfcGeomWires.cpp index 3c04914b76..99ad42099e 100644 --- a/src/ifcgeom/IfcGeomWires.cpp +++ b/src/ifcgeom/IfcGeomWires.cpp @@ -304,7 +304,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCompositeCurve* l, TopoDS_Wire use_radians = true; } else { // No heuristic left to prefer the one over the other, - // apparently both variants are equally succesful. + // apparently both variants are equally successful. // The curve might be composed of only straight segments. // Let's go with the wire created using radians as that // at least is a SI unit. diff --git a/src/ifcmax/IfcMax.cpp b/src/ifcmax/IfcMax.cpp index 28ab422882..64017f5501 100644 --- a/src/ifcmax/IfcMax.cpp +++ b/src/ifcmax/IfcMax.cpp @@ -294,7 +294,7 @@ int IFCImp::DoImport(const TCHAR *name, ImpInterface *impitfc, Interface *itfc, tri->mesh.buildNormals(); // Either use this or undefine the FACESETS_AS_COMPOUND option in IfcGeom.h to have // properly oriented normals. Using only the line below will result in a consistent - // orientation of normals accross shells, but not always oriented towards the + // orientation of normals across shells, but not always oriented towards the // outside. // tri->mesh.UnifyNormals(false); tri->mesh.BuildStripsAndEdges(); diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index f2c88fa398..badbaed3d4 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -196,7 +196,7 @@ class entity_instance(object): attr_value = entity_instance.walk(is_instance, get_info_, attr_value) yield self.attribute_name(i), attr_value except BaseException: - logging.exception("unhandled exception occured setting attribute name for {}".format(self)) + logging.exception("unhandled exception occurred setting attribute name for {}".format(self)) return return_type(_()) diff --git a/src/ifcparse/IfcWrite.h b/src/ifcparse/IfcWrite.h index 5c5bc8f775..c0a8c2598e 100644 --- a/src/ifcparse/IfcWrite.h +++ b/src/ifcparse/IfcWrite.h @@ -80,7 +80,7 @@ namespace IfcWrite { boost::dynamic_bitset<>, // An enumeration argument, e.g. .USERDEFINED. // To initialize the argument a string representation - // has to be explicitely passed of the enumeration value + // has to be explicitly passed of the enumeration value // which is stored internally as an integer. The argument // itself does not keep track of what schema enumeration // type is represented. diff --git a/win/build-deps.cmd b/win/build-deps.cmd index 43e59b4174..dbfbaeafb9 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -145,7 +145,7 @@ echo. cd "%DEPS_DIR%" -:: Note all of the depedencies have approriate label so that user can easily skip something if wanted +:: Note all of the dependencies have appropriate label so that user can easily skip something if wanted :: by modifying this file and using goto. :Boost :: NOTE Boost < 1.64 doesn't work without tricks if the user has only VS 2017 installed and no earlier versions. diff --git a/win/readme.md b/win/readme.md index 70c7b93e14..e8e4c5107a 100644 --- a/win/readme.md +++ b/win/readme.md @@ -15,7 +15,7 @@ Usage Instructions Building using MSYS is very similar to using the MSVC batch files, but instead the shell scripts are used. Note that the MSYS support is currently a bit experimental. It is advised to check out the contents of the shell scripts before using them. Note that contrary to MSVC, with MSYS all of the dependencies are not -built or used as static libaries. Currently Release build is used for all libraries. +built or used as static libraries. Currently Release build is used for all libraries. ### MSVC Execute `build-deps.cmd` to fetch, build and install the dependencies. The batch file will print the requirements for @@ -28,7 +28,7 @@ deduced from the MSVC environment variables. User-friendly VS generator shorthan `vs2013-x86` or `vs2015-x64`, and these are converted to the appropriate CMake ones by the scripts. A build type (`Build`, `Rebuild`, or `Clean`, defaults to `Build`) can be provided as `%3`. See `vs-cfg.cmd` if you wish to change the defaults. The batch file will create `deps\` and `deps-vs--installed\` directories to the -project root. Debug and release builds of the depedencies can co-exist by simply running +project root. Debug and release builds of the dependencies can co-exist by simply running ``` > build-deps.cmd Debug > build-deps.cmd From 229a708fc3edc1d38c928947750b8642b73b8799 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 7 Sep 2018 14:25:46 +0200 Subject: [PATCH 2/2] Emit error messages on missing units --- src/ifcgeom/IfcGeomFunctions.cpp | 12 ++++++++++++ src/ifcgeom/IfcGeomIterator.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 7ed8ddc228..feb851b803 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -1580,6 +1580,8 @@ std::pair IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUn std::string unit_name = "METER"; double unit_magnitude = 1.; + bool length_unit_encountered = false, angle_unit_encountered = false; + try { IfcEntityList::ptr units = unit_assignment->Units(); if (!units || !units->size()) { @@ -1609,8 +1611,10 @@ std::pair IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUn unit_name = current_unit_name; unit_magnitude = current_unit_magnitude; setValue(IfcGeom::Kernel::GV_LENGTH_UNIT, current_unit_magnitude); + length_unit_encountered = true; } else { setValue(IfcGeom::Kernel::GV_PLANEANGLE_UNIT, current_unit_magnitude); + angle_unit_encountered = true; } } } @@ -1623,6 +1627,14 @@ std::pair IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUn Logger::Message(Logger::LOG_ERROR, ss.str()); } + if (!length_unit_encountered) { + Logger::Error("No length unit encountered"); + } + + if (!angle_unit_encountered) { + Logger::Error("No plane angle unit encountered"); + } + return std::pair(unit_name, unit_magnitude); } diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h index e6898df684..499f042c48 100644 --- a/src/ifcgeom/IfcGeomIterator.h +++ b/src/ifcgeom/IfcGeomIterator.h @@ -145,6 +145,8 @@ namespace IfcGeom { std::pair length_unit = kernel.initializeUnits(project->UnitsInContext()); unit_name = length_unit.first; unit_magnitude = length_unit.second; + } else { + Logger::Error("A single IfcProject is expected (encountered " + boost::lexical_cast(projects->size()) + "); unable to read unit information."); } }