mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #5854. Update docs with new IOS v0.8 settings.
This commit is contained in:
@@ -2,7 +2,8 @@ IfcConvert
|
||||
==========
|
||||
|
||||
IfcConvert is a command-line application for converting IFC geometry into file
|
||||
formats such as OBJ, DAE, GLB, STP, IGS, XML, SVG, H5, and IFC itself.
|
||||
formats such as OBJ, DAE, GLB, STP, IGS, XML, SVG, H5, CityJSON, TTL/WKT, and
|
||||
IFC-SPF itself.
|
||||
|
||||
For other formats, you may use other IfcOpenShell utilities as shown in the
|
||||
table below.
|
||||
@@ -12,7 +13,7 @@ table below.
|
||||
+=========================+=========================+======================+
|
||||
| .ifc | .obj, .dae, .glb, .stp, | IfcConvert |
|
||||
| | .igs, .xml, .svg, .h5, | |
|
||||
| | .ifc | |
|
||||
| | .cityjson, .ttl, .ifc | |
|
||||
+-------------------------+-------------------------+----------------------+
|
||||
| .ifc | .dae, .abc, .usd, .obj, | Bonsai_ |
|
||||
| | .ply, .stl, .fbx, .glb, | |
|
||||
|
||||
@@ -70,7 +70,7 @@ CLI Manual
|
||||
|
||||
$ IfcConvert -h
|
||||
|
||||
IfcOpenShell IfcConvert v0.8.0-dc67287d (OCC 7.5.3)
|
||||
IfcOpenShell IfcConvert 0.8.1-c49ca69 (OCC 7.8.1)
|
||||
Usage: IfcConvert [options] <input.ifc> [<output>]
|
||||
|
||||
Converts (the geometry in) an IFC file into one of the following formats:
|
||||
@@ -82,6 +82,8 @@ CLI Manual
|
||||
.xml XML Property definitions and decomposition tree
|
||||
.svg SVG Scalable Vector Graphics (2D floor plan)
|
||||
.h5 HDF Hierarchical Data Format storing positions, normals and indices
|
||||
.cityjson City JSON format for geospatial data
|
||||
.ttl TTL/WKT RDF Turtle with Well-Known-Text geometry
|
||||
.ifc IFC-SPF Industry Foundation Classes
|
||||
|
||||
If no output filename given, <input>.obj will be used as the output file.
|
||||
@@ -92,9 +94,6 @@ CLI Manual
|
||||
--version display version information
|
||||
-v [ --verbose ] more verbose log messages. Use twice
|
||||
(-vv) for debugging level.
|
||||
-d [ --debug ] write boolean operands to file in
|
||||
current directory for debugging
|
||||
purposes
|
||||
-q [ --quiet ] less status and progress output
|
||||
--cache cache geometry creation. Use
|
||||
--cache-file to specify cache file
|
||||
@@ -109,42 +108,10 @@ CLI Manual
|
||||
--log-file arg redirect log output to file
|
||||
|
||||
Geometry options:
|
||||
--kernel arg (=opencascade) Geometry kernel to use (opencascade,
|
||||
cgal, cgal-simple).
|
||||
-j [ --threads ] arg (=1) Number of parallel processing threads
|
||||
for geometry interpretation.
|
||||
--plan Specifies whether to include curves in
|
||||
the output result. Typically these are
|
||||
representations of type Plan or Axis.
|
||||
Excluded by default.
|
||||
--model Specifies whether to include surfaces
|
||||
and solids in the output result.
|
||||
Typically these are representations of
|
||||
type Body or Facetation. Included by
|
||||
default.
|
||||
--weld-vertices Specifies whether vertices are welded,
|
||||
meaning that the coordinates vector
|
||||
will only contain unique xyz-triplets.
|
||||
This results in a manifold mesh which
|
||||
is useful for modelling applications,
|
||||
but might result in unwanted shading
|
||||
artefacts in rendering applications.
|
||||
--use-world-coords Specifies whether to apply the local
|
||||
placements of building elements
|
||||
directly to the coordinates of the
|
||||
representation mesh rather than to
|
||||
represent the local placement in the
|
||||
4x3 matrix, which will in that case be
|
||||
the identity matrix.
|
||||
--convert-back-units Specifies whether to convert back
|
||||
geometrical output back to the unit of
|
||||
measure in which it is defined in the
|
||||
IFC file. Default is to use meters.
|
||||
--orient-shells Specifies whether to orient the faces
|
||||
of IfcConnectedFaceSets. This is a
|
||||
potentially time consuming operation,
|
||||
but guarantees a consistent orientation
|
||||
of surface normals, even if the faces
|
||||
are not properly oriented in the IFC
|
||||
file.
|
||||
--center-model Centers the elements by applying the
|
||||
center point of all placements as an
|
||||
offset.Can take several minutes on
|
||||
@@ -152,26 +119,6 @@ CLI Manual
|
||||
--center-model-geometry Centers the elements by applying the
|
||||
center point of all mesh vertices as an
|
||||
offset.
|
||||
--model-offset arg Applies an arbitrary offset of form
|
||||
'x;y;z' to all placements.
|
||||
--model-rotation arg Applies an arbitrary quaternion
|
||||
rotation of form 'x;y;z;w' to all
|
||||
placements.
|
||||
--disable-opening-subtractions Specifies whether to disable the
|
||||
boolean subtraction of
|
||||
IfcOpeningElement Representations from
|
||||
their RelatingElements.
|
||||
--disable-boolean-results Specifies whether to disable the
|
||||
boolean operation within
|
||||
representations such as clippings by
|
||||
means of IfcBooleanResult and subtypes
|
||||
--no-2d-boolean Do not attempt to process boolean
|
||||
subtractions in 2D.
|
||||
--enable-layerset-slicing Specifies whether to enable the slicing
|
||||
of products according to their
|
||||
associated IfcMaterialLayerSet.
|
||||
--layerset-first Assigns the first layer material of the
|
||||
layerset to the complete product.
|
||||
--include arg Specifies that the instances that match
|
||||
a specific filtering criteria are to be
|
||||
included in the geometrical output:
|
||||
@@ -227,40 +174,159 @@ CLI Manual
|
||||
inserted on their own lines. See
|
||||
--include, --include+, --exclude, and
|
||||
--exclude+ for more details.
|
||||
--no-normals Disables computation of normals. Saves
|
||||
--default-material-file arg Specifies a material file that
|
||||
describes the material object types
|
||||
will haveif an object does not have any
|
||||
specified material in the IFC file.
|
||||
--exterior-only [=arg(=minkowski-triangles)] (=none)
|
||||
Export only the exterior shell of the
|
||||
building found by geometric analysis.
|
||||
convex-decomposition,
|
||||
minkowski-triangles or
|
||||
halfspace-snapping
|
||||
--plan Specifies whether to include curves in
|
||||
the output result. Typically these are
|
||||
representations of type Plan or Axis.
|
||||
Excluded by default.
|
||||
--model Specifies whether to include surfaces
|
||||
and solids in the output result.
|
||||
Typically these are representations of
|
||||
type Body or Facetation.
|
||||
--mesher-linear-deflection arg (= 0.001)
|
||||
Specifies the linear deflection of the
|
||||
mesher. Controls the detail of curved
|
||||
surfaces in triangulated output
|
||||
formats.
|
||||
--mesher-angular-deflection arg (= 0.5)
|
||||
Sets the angular tolerance of the
|
||||
mesher in radians 0.5 by default if not
|
||||
specified.
|
||||
--reorient-shells Specifies whether to orient the faces
|
||||
of IfcConnectedFaceSets. This is a
|
||||
potentially time consuming operation,
|
||||
but guarantees a consistent orientation
|
||||
of surface normals, even if the faces
|
||||
are not properly oriented in the IFC
|
||||
file.
|
||||
--length-unit arg (= 1)
|
||||
--angle-unit arg (= 1)
|
||||
--precision arg (= 1e-05)
|
||||
--dimensionality arg (= 1) Specifies whether to include curves
|
||||
and/or surfaces and solids in the
|
||||
output result. Defaults to only
|
||||
surfaces and solids.
|
||||
--layerset-first Assigns the first layer material of the
|
||||
layerset to the complete product.
|
||||
--disable-boolean-result Specifies whether to disable the
|
||||
boolean operation within
|
||||
representations such as clippings by
|
||||
means of IfcBooleanResult and subtypes
|
||||
--no-wire-intersection-check Skip wire intersection check.
|
||||
--no-wire-intersection-tolerance arg (= 0)
|
||||
Set wire intersection tolerance to 0.
|
||||
--precision-factor arg (= 1) Option to increase linear tolerance for
|
||||
more permissive edge curves and fewer
|
||||
artifacts after boolean operations at
|
||||
the expense of geometric detail due to
|
||||
vertex collapsing and wire intersection
|
||||
fuzziness.
|
||||
--debug write boolean operands to file in
|
||||
current directory for debugging
|
||||
purposes
|
||||
--boolean-attempt-2d Do not attempt to process boolean
|
||||
subtractions in 2D.
|
||||
--surface-colour Prioritizes the surface color instead
|
||||
of using diffuse.
|
||||
--weld-vertices Specifies whether vertices are welded,
|
||||
meaning that the coordinates vector
|
||||
will only contain unique xyz-triplets.
|
||||
This results in a manifold mesh which
|
||||
is useful for modelling applications,
|
||||
but might result in unwanted shading
|
||||
artefacts in rendering applications.
|
||||
--use-world-coords Specifies whether to apply the local
|
||||
placements of building elements
|
||||
directly to the coordinates of the
|
||||
representation mesh rather than to
|
||||
represent the local placement in the
|
||||
4x3 matrix, which will in that case be
|
||||
the identity matrix.
|
||||
--unify-shapes Unify adjacent co-planar and co-linear
|
||||
subshapes (topological entities sharing
|
||||
the same geometric domain) before
|
||||
triangulation or further processing
|
||||
--use-material-names Use material names instead of unique
|
||||
IDs for naming materials upon
|
||||
serialization. Applicable for OBJ and
|
||||
DAE output.
|
||||
--convert-back-units Specifies whether to convert back
|
||||
geometrical output back to the unit of
|
||||
measure in which it is defined in the
|
||||
IFC file. Default is to use meters.
|
||||
--context-ids arg
|
||||
--context-ids arg
|
||||
--context-ids arg
|
||||
--iterator-output arg (= 0)
|
||||
--disable-opening-subtractions Specifies whether to disable the
|
||||
boolean subtraction of
|
||||
IfcOpeningElement Representations from
|
||||
their RelatingElements.
|
||||
--apply-default-materials
|
||||
--no-normals Disables computation of normals.Saves
|
||||
time and file size and is useful in
|
||||
instances where you're going to
|
||||
recompute normals for the exported
|
||||
model in other modelling application in
|
||||
any case.
|
||||
--deflection-tolerance arg (=0.001) Sets the deflection tolerance of the
|
||||
mesher, 1e-3 by default if not
|
||||
specified.
|
||||
--force-space-transparency arg Overrides transparency of spaces in
|
||||
geometry output.
|
||||
--angular-tolerance arg (=0.5) Sets the angular tolerance of the
|
||||
mesher in radians 0.5 by default if not
|
||||
specified.
|
||||
--generate-uvs Generates UVs (texture coordinates) by
|
||||
using simple box projection. Requires
|
||||
normals. Not guaranteed to work
|
||||
properly if used with --weld-vertices.
|
||||
--default-material-file arg Specifies a material file that
|
||||
describes the material object types
|
||||
will haveif an object does not have any
|
||||
specified material in the IFC file.
|
||||
--enable-layerset-slicing Specifies whether to enable the slicing
|
||||
of products according to their
|
||||
associated IfcMaterialLayerSet.
|
||||
--element-hierarchy Assign the elements using their e.g
|
||||
IfcBuildingStorey parent.Applicable to
|
||||
DAE output.
|
||||
--validate Checks whether geometrical output
|
||||
conforms to the included explicit
|
||||
quantities.
|
||||
--no-wire-intersection-check Skip wire intersection check.
|
||||
--no-wire-intersection-tolerance Set wire intersection tolerance to 0.
|
||||
--strict-tolerance Use exact tolerance from model. Default
|
||||
is a 10 times increase for more
|
||||
permissive edge curves and fewer
|
||||
artifacts after boolean operations at
|
||||
the expense of geometric detail due to
|
||||
vertex collapsing and wire intersection
|
||||
fuzziness.
|
||||
--edge-arrows Adds arrow heads to edge segments to
|
||||
signify edge direction
|
||||
--building-local-placement Similar to --site-local-placement, but
|
||||
placing elements in locally in the
|
||||
parent IfcBuilding coord system
|
||||
--site-local-placement Place elements locally in the IfcSite
|
||||
coordinate system, instead of placing
|
||||
them in the IFC global coords.
|
||||
Applicable for OBJ, DAE, and STP
|
||||
output.
|
||||
--force-space-transparency arg Overrides transparency of spaces in
|
||||
geometry output.
|
||||
--circle-segments arg (= 16) Number of segments to approximate full
|
||||
circles in CGAL kernel.
|
||||
--keep-bounding-boxes Default is to removes IfcBoundingBox
|
||||
from model prior to converting
|
||||
geometry.Setting this option disables
|
||||
that behaviour
|
||||
--function-step-type arg (= 0) Indicates the method used for defining
|
||||
step size when evaluating
|
||||
function-based curves. Provides
|
||||
interpretation of function-step-param
|
||||
--function-step-param arg (= 0.5) Indicates the parameter value for
|
||||
defining step size when evaluating
|
||||
function-based curves.
|
||||
--no-parallel-mapping Perform mapping upfront
|
||||
(single-threaded) as opposed to in
|
||||
parallel. May decrease performance, but
|
||||
also decrease output size (in the
|
||||
future)
|
||||
--model-offset arg Applies an arbitrary offset of form
|
||||
'x,y,z' to all placements.
|
||||
--model-rotation arg Applies an arbitrary quaternion
|
||||
rotation of form 'x,y,z,w' to all
|
||||
placements.
|
||||
--triangulation-type arg (= 0) Type of planar facet to be emitted
|
||||
|
||||
Serialization options:
|
||||
--bounds arg Specifies the bounding rectangle, for
|
||||
@@ -296,6 +362,10 @@ CLI Manual
|
||||
data-guid
|
||||
--svg-poly Uses the polygonal algorithm for hidden
|
||||
line rendering
|
||||
--svg-prefilter Prefilter faces and shapes before
|
||||
feeding to HLR algorithm
|
||||
--svg-segment-projection Segment result of projection wrt
|
||||
original products
|
||||
--svg-write-poly Approximate every curve as polygonal in
|
||||
SVG output
|
||||
--svg-project Always enable hidden line rendering
|
||||
@@ -310,47 +380,6 @@ CLI Manual
|
||||
--section-height-from-storeys Derives section height from storey
|
||||
elevation. Use --section-height to
|
||||
override default offset of 1.2
|
||||
--use-element-names Use entity instance IfcRoot.Name
|
||||
instead of unique IDs for naming
|
||||
elements upon serialization. Applicable
|
||||
for OBJ, DAE, and SVG output.
|
||||
--use-element-guids Use entity instance IfcRoot.GlobalId
|
||||
instead of unique IDs for naming
|
||||
elements upon serialization. Applicable
|
||||
for OBJ, DAE, and SVG output.
|
||||
--use-element-numeric-ids Use the numeric step identifier (entity
|
||||
instance name) for naming elements upon
|
||||
serialization. Applicable for OBJ, DAE,
|
||||
and SVG output.
|
||||
--use-material-names Use material names instead of unique
|
||||
IDs for naming materials upon
|
||||
serialization. Applicable for OBJ and
|
||||
DAE output.
|
||||
--use-element-types Use element types instead of unique IDs
|
||||
for naming elements upon serialization.
|
||||
Applicable for DAE output.
|
||||
--use-element-hierarchy Order the elements using their
|
||||
IfcBuildingStorey parent. Applicable
|
||||
for DAE output.
|
||||
--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.
|
||||
--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 arg (=15) Sets the precision to be used to format
|
||||
floating-point values, 15 by default.
|
||||
Use a negative value to use the
|
||||
system's default precision (should be 6
|
||||
typically). Applicable for OBJ and DAE
|
||||
output. For DAE output, value >= 15
|
||||
means that up to 16 decimals are used,
|
||||
and any other value means that 6 or 7
|
||||
decimals are used.
|
||||
--print-space-names Prints IfcSpace LongName and Name in
|
||||
the geometry output. Applicable for SVG
|
||||
output
|
||||
@@ -359,6 +388,37 @@ CLI Manual
|
||||
output
|
||||
--space-name-transform arg Additional transform to the space
|
||||
labels in SVG
|
||||
--edge-arrows Adds arrow heads to edge segments to
|
||||
signify edge direction
|
||||
|
||||
--use-element-names Use entity instance IfcRoot.Name
|
||||
instead of unique IDs for naming
|
||||
elements upon serialization. Applicable
|
||||
for OBJ, DAE, STP, and SVG output.
|
||||
--use-element-guids Use entity instance IfcRoot.GlobalId
|
||||
instead of unique IDs for naming
|
||||
elements upon serialization. Applicable
|
||||
for OBJ, DAE, STP, and SVG output.
|
||||
--use-element-step-ids Use the numeric step identifier (entity
|
||||
instance name) for naming elements upon
|
||||
serialization. Applicable for OBJ, DAE,
|
||||
STP, and SVG output.
|
||||
--use-element-types Use element types instead of unique IDs
|
||||
for naming elements upon serialization.
|
||||
Applicable to DAE output.
|
||||
--y-up Change the 'up' axis to positive Y,
|
||||
default is Z UP. Applicable to OBJ
|
||||
output.
|
||||
--ecef Write glTF in Earth-Centered
|
||||
Earth-Fixed coordinates. Requires PROJ.
|
||||
--digits arg (= 15) Sets the precision to be used to format
|
||||
floating-point values, 15 by default.
|
||||
Use a negative value to use the
|
||||
system's default precision (should be 6
|
||||
typically). Applicable for OBJ and DAE
|
||||
output. For DAE output, value >= 15
|
||||
means that up to 16 decimals are used,
|
||||
and any other value means that 6 or 7
|
||||
decimals are used.
|
||||
--base-uri arg Base URI for products to be used in
|
||||
RDF-based serializations.
|
||||
--wkt-use-section Use a geometrical section rather than
|
||||
full polyhedral output and footprint in
|
||||
TTL WKT
|
||||
|
||||
@@ -128,7 +128,7 @@ Alternatively, you may choose to retrieve an OpenCASCADE BRep:
|
||||
element = ifc_file.by_type('IfcWall')[0]
|
||||
|
||||
settings = ifcopenshell.geom.settings()
|
||||
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
|
||||
settings.set("use-python-opencascade", True)
|
||||
|
||||
try:
|
||||
shape = geom.create_shape(settings, element)
|
||||
@@ -301,6 +301,9 @@ Here is a typical example to serialising to glTF / glb. Example settings to
|
||||
serialise to other formats are shown commented out. Different serialisations
|
||||
may require different settings.
|
||||
|
||||
In addition to geometry settings, serialisation has its own set of
|
||||
:doc:`../ifcopenshell/serialiser_settings`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import ifcopenshell
|
||||
@@ -310,25 +313,23 @@ may require different settings.
|
||||
settings = ifcopenshell.geom.settings()
|
||||
|
||||
# Settings for glTF / glb
|
||||
settings.set(settings.STRICT_TOLERANCE, True)
|
||||
settings.set(settings.INCLUDE_CURVES, True)
|
||||
# Setting element GUIDs is optional, but useful to uniquely identify objects in non-semantic formats.
|
||||
settings.set(settings.USE_ELEMENT_GUIDS, True)
|
||||
settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
||||
# Note that applying default materials is required in glTF serialisation.
|
||||
settings.set(settings.APPLY_DEFAULT_MATERIALS, True)
|
||||
settings.set("apply-default-materials", True)
|
||||
|
||||
# Settings for obj
|
||||
# settings.set(settings.STRICT_TOLERANCE, True)
|
||||
# settings.set(settings.INCLUDE_CURVES, True)
|
||||
# settings.set(settings.USE_ELEMENT_GUIDS, True)
|
||||
# settings.set(settings.APPLY_DEFAULT_MATERIALS, True)
|
||||
# settings.set(settings.USE_WORLD_COORDS, True)
|
||||
# settings.set("dimensionality", ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
||||
# settings.set("apply-default-materials", True)
|
||||
# settings.set("use-world-coords", True)
|
||||
|
||||
# Serialise to glTF / glb
|
||||
serialiser = ifcopenshell.geom.serializers.gltf("output.glb", settings)
|
||||
self.serialiser_settings = ifcopenshell.geom.serializer_settings()
|
||||
# Setting element GUIDs is optional, but useful to uniquely identify objects in non-semantic formats.
|
||||
serialiser_settings.set("use-element-guids", True)
|
||||
|
||||
# Serialise to obj
|
||||
# serialiser = ifcopenshell.geom.serializers.obj('output.obj', 'output.mtl', settings)
|
||||
# serialiser = ifcopenshell.geom.serializers.obj('output.obj', 'output.mtl', settings, serialiser_settings)
|
||||
|
||||
serialiser.setFile(self.file)
|
||||
serialiser.setUnitNameAndMagnitude("METER", 1.0)
|
||||
|
||||
@@ -24,4 +24,5 @@ possible at compile-time when using C++ and at run-time when using Python.
|
||||
ifcopenshell/getting_started
|
||||
ifcopenshell/geometry_iterator
|
||||
ifcopenshell/geometry_settings
|
||||
ifcopenshell/serialiser_settings
|
||||
ifcopenshell/boolean_process
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user