Commit Graph

69 Commits

Author SHA1 Message Date
Stephen Boddy 183e4c47f7 Add SVG edge classification on/off + render settings
Add svg-use-edge-classification (default off, preserving today's
linework), svg-render-crease-edges, and svg-render-sharp-edges
settings, gating the existing 5-class classification feature so it
can be disabled entirely (falling back to the pre-classification
whole-shape output) or have individual classes suppressed.

Also fixes a bug uncovered while wiring this into Bonsai: ready(),
where geometry_settings() actually gets read into the serializer,
was only ever invoked explicitly by IfcConvert's CLI driver and
isn't exposed to Python. Every Svg* setting -- including the three
from previous rounds -- silently stayed at its hardcoded constructor
default when the serializer was constructed directly through the
Python bindings, as Bonsai does. Fixed by calling ready() from
SvgSerializer's own constructor, safe since it only reads
geometry_settings() with no other side effects, and settings are
always finalized before construction in every call path.

Generated with the assistance of an AI coding tool.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 01:33:15 +01:00
Stephen Boddy f0970b90b0 Classify projection edges in SVG elevations
Adds boundary/outline/sharp/crease/flush classification of HLR
projection edges in SvgSerializer, so CSS can style silhouettes,
ridges, and valleys differently instead of drawing every edge
identically (fixes the "ugly faceted sphere" problem from #3668).

Classification happens pre-HLR on the original solid's real face
topology (three prior attempts tried to classify HLR's own output,
which carries no face topology at all and can't be correlated back
by edge identity). Each class's visible portion is then extracted via
HLRBRep_HLRToShape::VCompound(S)/OutLineVCompound(S), the same
per-shape filtering mechanism already used for per-product
segmentation, applied per class instead. Classes are tagged directly
on individual <path> elements so Bonsai's merge_linework_and_add_metadata
group-level class rewrite in operator.py never touches them.

New settings: svg-ridge-angle-min-degrees, svg-valley-angle-min-degrees,
svg-emit-flush-edges (ConversionSettings.h), wired through Bonsai's
CreateDrawing operator and exposed via its redo panel.

Refs #3668.

Generated with the assistance of an AI coding tool.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 01:33:15 +01:00
Andrej730 2155e3206f logger: use Logger* instead of Logger& to propagate signature using swig
See the comment in IfcLogger.h explaining this.
2026-07-16 17:28:24 +05:00
Thomas Krijnen a7738eeb64 Pass around non-static logger instances and programmatic access to messages in-memory 2026-06-10 18:40:17 +02:00
Thomas Krijnen a751fb956d Introduce unique error codes 2026-06-10 18:40:17 +02:00
Thomas Krijnen b9f790217e Initialize only_valid_ 2024-12-01 11:21:58 +01:00
Thomas Krijnen d80bcd1a94 Unify variant storage (#5118) 2024-08-23 20:29:07 +02:00
Thomas Krijnen c16d49d683 #4450 don't fail on empty bbox in prefiltering 2024-04-18 10:48:06 +02:00
Thomas Krijnen 75b9e6cec9 setOnlyValid() option that skips and logs invalid topology #4130 2024-04-17 14:57:44 +02:00
Thomas Krijnen 946a21146a Add missing includes after merge resolution 2024-04-17 14:54:39 +02:00
Thomas Krijnen 5af30b6f07 #3660 Oops... propagate setting 2024-04-16 10:26:58 +02:00
Thomas Krijnen dc84f84e86 #3660 setSegmentProjection() / --svg-segment-projection options 2024-04-16 10:26:51 +02:00
Dion Moult 9cb3ce1f9a See #2894. Implement SVG mirroring options (typically used for RCPs or useful when converting to other things like DXF). 2024-04-16 10:24:54 +02:00
Thomas Krijnen 9adb4ac82b #3510 Sample points along diagonal as well for quick and dirty occlusion detection 2024-04-16 10:24:53 +02:00
Thomas Krijnen 23d096be07 SVG serialization UnifyInputs option 2024-04-16 10:10:48 +02:00
Thomas Krijnen 26d0f98cd9 #3359 return early in case of no-prefiltering 2024-04-15 13:30:41 +02:00
Thomas Krijnen fe7d550ef7 Help swig not to trip over old occt handle definitions 2024-04-15 13:29:18 +02:00
Thomas Krijnen 09d7cd97c8 SVG prefiltering elements based on large faces 2024-04-15 13:28:13 +02:00
Thomas Krijnen 65e874c67f Drastic settings refactoring 2023-11-15 10:32:33 +01:00
Thomas Krijnen 2b1b79bf1c Make occt optional 2023-03-22 11:17:14 +01:00
Thomas Krijnen c78b2893de Proceed with merge 2023-03-21 20:15:01 +01:00
Adrien SCHVALBERG 42448cae4e Add missing exports for ifcopenshell-python when we build shared libs. 2022-05-09 14:13:47 +02:00
Thomas Krijnen eccf72ee8a #1153 option to preprocess shape into sets of profile edges 2021-11-20 14:02:12 +01:00
Bruno Postle 604fbc4bc9 Raise default section height from storey from 1.0 to 1.2 2021-11-16 09:12:42 +01:00
Thomas Krijnen 5633445008 #1153 evenodd 2021-11-05 11:21:19 +01:00
Thomas Krijnen be9ef33932 #1153 svg subtraction settings 2021-11-02 08:57:00 +01:00
Thomas Krijnen bdc6fcb66f #1803 Use abstract GeometrySerializer as cache to eliminate cyclic dependencies 2021-10-18 11:38:01 +02:00
Thomas Krijnen 666b55b3a3 Fix unref param addDrawing() 2021-10-04 10:40:19 +02:00
Thomas Krijnen a7d349cbac SVG addDrawing() option 2021-08-17 14:50:04 +02:00
Thomas Krijnen 9cc3810650 Initialize storey_height_display_ 2021-08-17 13:50:37 +02:00
Thomas Krijnen 43f528ce04 Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0
# Conflicts:
#	src/ifcgeom/IfcGeomTree.h
#	src/ifcgeom_schema_agnostic/IfcGeomIterator.h
#	src/ifcgeom_schema_agnostic/IteratorImplementation.cpp
#	src/ifcgeom_schema_agnostic/IteratorImplementation.h
#	src/ifcparse/Ifc4x3_rc3.cpp
#	src/ifcparse/Ifc4x3_rc3.h
#	src/serializers/SvgSerializer.cpp
2021-08-10 14:30:07 +02:00
Thomas Krijnen 92ca549b0b setNoCSS() 2021-08-08 18:10:19 +02:00
Thomas Krijnen 2213b4e212 --elevation-ref-guid setElevationRefGuid 2021-08-08 18:06:58 +02:00
Thomas Krijnen 975379a3a4 approach to pass stringstream to serializers 2021-07-11 15:01:31 +02:00
Thomas Krijnen eeaf04c6ea Remove templates on iterator and element 2021-07-11 15:00:59 +02:00
Thomas Krijnen f032378ca7 no double/float parametrization anymore 2021-07-11 11:03:35 +02:00
Thomas Krijnen e06794ef3d #1153 SVG OBB check 2021-04-24 11:05:18 +02:00
Thomas Krijnen bb6312e174 #1153 --svg-without-storeys and correct positioning and scale based on annotation block 2021-04-18 15:03:28 +02:00
Thomas Krijnen 776c68e2b0 --svg-write-poly 2021-04-15 10:36:37 +02:00
Thomas Krijnen 89557460c8 SVG text annotation descriptions 2021-04-02 21:59:49 +02:00
Thomas Krijnen 08ec3fc73f SVG --space-name-transform 2021-03-28 22:16:58 +02:00
Thomas Krijnen f1d7cf1dfb SVG --storey-height-line-length 2021-03-28 21:38:29 +02:00
Thomas Krijnen 1ee488b148 Quick solution for inline dasharray 2021-03-28 16:55:52 +02:00
Thomas Krijnen 88f26eaead Work towards #1153 2021-03-28 12:48:20 +02:00
Thomas Krijnen 28fa774a9a SVG --draw-storey-heights=left option 2021-03-09 16:11:42 +01:00
Thomas Krijnen 30fc2ad580 SVG: Fix storey elevations 2021-03-07 12:07:40 +01:00
Thomas Krijnen 4ca64ac42e SVG: preliminary --draw-storey-heights 2021-03-05 21:50:32 +01:00
Thomas Krijnen b1232ecb02 Option to use projection logic on floor plans 2021-01-27 22:34:19 +01:00
Thomas Krijnen 979f37d7c6 --svg-poly option and correct HLR view direction 2021-01-02 12:34:10 +01:00
Thomas Krijnen c3d4ce8f51 Store drawing location in SVG 2020-12-31 11:31:05 +01:00