Commit Graph

156 Commits

Author SHA1 Message Date
gsdali 07e6d8d40e Modeling Data - Fix AdvApp2Var Jacobi maxima written to the wrong workspace slot (#1418)
Fixed approximation of spherical surfaces]
Regression after https://github.com/Open-Cascade-SAS/OCCT/commit/3016a390713d2e893f4bfa797882b9f0266840e1
2026-08-10 12:20:16 +01:00
Pasukhin Dmitry 5eba9aff4f Tests - Migrate DRAW tests to Gtests (#1448)
Migrate some DRAW tests which do not use external
  CAD files and which do not use visualisation/image dump.
Some tests were modified, but the original idea was preserved
2026-08-09 22:10:30 +01:00
Pasukhin Dmitry 0d47342863 Coding, Modeling Data - Clean up dead headers (#1439) 2026-08-08 07:19:35 +01:00
Andy Aragon d8b85a6626 Modeling - Optimize elementary deviations in GeomLib_CheckCurveOnSurface (#1373)
Use Adaptor3d_CurveOnSurface composed-curve recognition to handle
  provable elementary cases directly:
- compute the exact maximum at interval endpoints for line pairs;
- Compute exact maxima for line pairs and use trigonometric roots for
   circle and ellipse pairs.
- preserve the existing PSO/Newton pipeline for all other cases.
---------
CLA ID 1148
Co-authored-by: dpasukhi <dpasukhi@opencascade.com>
2026-07-29 19:01:17 +01:00
Pasukhin Dmitry 6a7e068773 Modeling Data - Prevent exception in BRep_Tool::CurveOnPlane (#1402)
Validate the edge range against the effective curve basis before
constructing Geom_TrimmedCurve. Preserve valid periodic ranges and
return a null pcurve for inconsistent bounded ranges.
2026-07-28 12:38:53 +01:00
Dmitrii Kulikov 37c9279f44 Modeling - Boolean section stuck in infinite loop (#1329)
Method Geom_BSplineCurve::PeriodicNormalization() is rewritten - it now
has algorithmic complexity O(1) instead of O(N) and protected against
rounding error for large numbers.
2026-07-05 14:51:36 +01:00
Pasukhin Dmitry 13d19b9a1f Tests, BRepGraph - Add GTests for reversed face shell orientation (#1314)
- Add helper to create shell with all faces reversed
- Test FaceRef stores REVERSED orientation for all faces
- Test ParentExplorer reports shell as parent for reversed faces
- Test Reconstruct produces valid face definitions
- Test shell reconstruction preserves REVERSED face orientations
- Unify test fixture names to BRepGraph_ReverseTest
2026-06-16 09:03:48 +01:00
Pasukhin Dmitry 03856df0b9 Modeling Data - Fix BRepGraph topology placement population (#1311)
- Kept TopoDS definition data local while storing root
  and compound placements on graph references.
- Preserved located triangulation and polygon-on-triangulation
  data during population.
- Preserved degenerate natural boundary edges and cleared
  full-graph state consistently in Perform().
- Kept original TopoDS shape lookup bindings valid
  across population and compaction.
- Rebuilt compacted compounds in two passes so nested
  compound references keep their local placement.
- Added focused regression coverage for located meshes,
  nested compounds, shape lookup, compaction, degenerate boundaries, and reset behavior.
2026-06-15 15:46:00 +01:00
Pasukhin Dmitry ea3fc1f8bd Modeling, BRepGraph - Identity copy path, lock-free cache reads, per-CoEdge queries (#1306)
Identity copy path:
- copyFullGraphIdentity with PrepareForLoad() + direct slot assignment
- CopyDerivedRelationsFrom for O(K) relation vector copy
- CopyRemovedFlagsFrom for bulk removed-flag copy
- CopyShapeBindingsFrom for TShape/Original shape binding copy
- PrepareForLoad skips Clear() when storage already empty (IsEmpty fast path)
- appendRelationIdDirect for O(1) append in rebuild loop (duplicates structurally impossible)
- ChangeCompoundRefsOfNodeInternal uses TryBound for single lookup
- Counts() and ActiveCounts() accessors for Counts struct construction

Lock-free cache reads:
- EdgeEntry: packed atomic<uint8_t> (GeomStatus+IsClosed+IsComputed)
- CoEdgeSameRangeEntry: packed atomic<uint8_t> (SameRange+SameParameter+Computed)
- WireEntry: packed atomic<uint8_t> (IsClosed+IsComputed)
- ShellEntry: atomic<ClosureStatus> with Invalid sentinel
- All entries use memory_order_acquire/release pairs
- ensureSize handles lazy array growth (no myPreSized)
- Enums (GeomStatus, ClosureStatus) moved inside entry structs

Per-CoEdge queries:
- SameRange/SameParameter are per-CoEdge properties, bound to CoEdge OwnGen
- Edge class no longer has SameParameter/SameRange/IsClosed coedge overloads
- CoEdge class owns SameParameter/SameRange queries
- Test files use local edgeSameParameter/edgeSameRange helpers

Lock-free storage and registry:
- BRepGraphInc_Storage: atomic dirty flags for UID reverse indexes
- BRepGraph_LayerRegistry: atomic subscription masks for lock-free dispatch
- Ensure/EnsureCache/EnsureLayer: double-checked locking with shared fast path

Other optimizations:
- Iterator Next() fast-path: check next element validity inline
- NbFaces O(K) inline dedup with NCollection_LocalArray
- GeomAdaptor_Curve/Surface/Geom2dAdaptor_Curve for cached geometry eval
- Value() calls replaced with EvalD0() for clearer naming
- TargetItem returns value instead of pointer (no null-pointer risk)
- copyTopologyDefinitionsIdentity clears Curve3DRepId on GeomPolicy::Drop
- ensureEdgeEntry concurrency: fast-path validation + selective field merge
2026-06-14 14:15:32 +01:00
Pasukhin Dmitry 2b379b9f08 Foundation Classes - Fix thread-safety of Strtod by making Bigint pool thread-local (#1309)
- The Strtod() function used a shared static Bigint memory pool
  (private_mem, pmem_next, TI0) without synchronization.
- When multiple threads called Strtod() concurrently (e.g. parallel
  BRep reading), the pool was corrupted causing random mis-parses
  of numeric values.
- Fix: declare private_mem, pmem_next and TI0 as thread_local so
  each thread gets its own independent memory pool and freelist.
- Added Standard_Strtod_Test.cxx with parallel correctness tests
  using OSD_Parallel::For.
- Added BRepTools_Test.cxx with integration tests for parallel
  BRep file reading.
2026-06-14 12:39:10 +01:00
Pasukhin Dmitry 587da0ca3f Modeling Data - Rework BRepGraph storage and layers (#1305)
- Introduce item-level identifiers/remapping and move graph metadata to registered layers for history, locks, deferred state, parametric data, and supplemental topology.
- Replace the old reverse-index/cache/history helpers with storage-owned relations, version stamps, cache registry services, and copy/compact remapping paths.
- Preserve layer data, product occurrence refs, persistent mesh handles, deleted history, lock propagation, and topology supplement attachments across copy, compact, transform, reconstruct, and mutation flows.
- Update BRepGraph populate/reconstruct/editor traversal and add/refresh GTests for layers, cache services, copy, transform, compact, sparse models, IDs, and storage behavior.
2026-06-13 08:36:30 +01:00
Pasukhin Dmitry a43c1d2ae3 Foundation Classes - Add contiguous array views and mesh hashers (#1303)
- Added Array1 views for contiguous NCollection containers, including const read-only views for LinearVector and LocalArray.
- Updated Poly mesh containers and copy paths to preserve contiguous data, deflection, cached bounds, and triangulation parameters.
- Added mesh hashers for polygons and triangulations with tests covering tolerant equality and hash consistency.
- Kept the common base allocator alive through process finalization to avoid static destruction order crashes.
2026-06-12 07:26:51 +01:00
Pasukhin Dmitry 02530f0217 Modeling Algorithms - rework Gordon surface construction (#1292)
- Removed `Approx_BSplineApproxInterp` (and its GTest)
- Removed `GeomFill_GordonBuilder`.
- Added `GeomFill_GordonUtilities.pxx` for curve conversion/reparametrization and intersection-table preparation
- Added `GeomFill_NetworkSurface` for direct compatible-network surface construction.
- Updated `GeomFill_Gordon` API with explicit `ResultStatus`, approximate-fallback mode, and status reporting.
2026-06-04 23:49:50 +01:00
Pasukhin Dmitry d3adc95d96 Foundation Classes - Update Array1/2 Assign Operator (#1269)
- Updated `NCollection_Array1/2::Assign()` to copy bounds/size from the source; introduced `CopyValues()` to copy element values while preserving existing bounds.
- Replaced usages of `Assign()` / `operator=` with `CopyValues()` in several `Geom*` classes and math utilities to preserve prior behavior after the `Assign()` semantic change.
- Expanded GTests for `NCollection_Array1/2` to cover assignment behavior (owned/external buffers, size changes) and `CopyValues()` behavior.
2026-05-06 12:13:53 +01:00
Pasukhin Dmitry 9aa016011d Modeling - Restore old implementation of GProp (#1268)
- Reintroduced `GProp_PGProps` and `GProp_PEquation` implementations and registered them in `TKGeomBase`.
- Moved and split unit tests for point-set properties/equation analysis into `TKGeomBase` GTests.
- Updated callers and documentation, and removed the `PointSetLib` package from `TKMath`.
- Reverting #1140 357ae60dd9
2026-05-06 08:00:45 +01:00
Pasukhin Dmitry 6ba27a8c17 Modeling - Rework CoEdge definition to avoid misuse (#1261)
- Redesign seam detection/pairing to be connectivity-derived (`SeamPair()` walks sibling coedges on the same face with opposite orientations), with seam halves now present in wire `CoEdgeRefIds` to match TopoDS iteration.
- Move geometric continuity storage/round-trip to `BRepGraph_LayerRegularity` (including seam continuity), updating populate/reconstruct/editor APIs accordingly.
- Add/adjust GTests to cover seam ordering, seam symmetry, layer regularity behavior, and split/compact/reconstruct interactions under the new model.
2026-05-05 09:43:56 +01:00
Pasukhin Dmitry 883cece8e3 Shape Healing - Refactor shape replacement logic to handle cycles (#1247)
Apply some fixes where aaa82fc4de introduce as a regressions
2026-04-30 00:01:00 +01:00
Pasukhin Dmitry 91be8c4c71 Coding - Fix MSVC warnings (#1246)
- Replace various `Size()` calls with `Extent()`/`Length()` (int-returning) when passing element counts into `Message_ProgressScope`.
- Make “unsupported id type” fallbacks explicit in `BRepGraphInc_Storage` visitors to avoid MSVC control-path warnings.
- Minor warning-focused cleanups (loop variable rename in a test, use of `BRepGraph_NodeId::Invalid()`, removal of duplicated `Standard_EXPORT`).
2026-04-29 16:31:37 +01:00
Pasukhin Dmitry 1db8025677 Coding - Apply Clang-Tidy automatic fixes (#1245)
Flags:
aChecks="modernize-deprecated-headers,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nullptr,modernize-use-override,performance-avoid-endl,performance-move-constructor-init,readability-braces-around-statements,readability-delete-null-pointer,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-init,readability-static-accessed-through-instance"

clang-tidy version: 22.1.3
2026-04-29 15:04:38 +01:00
JIJINBEI 4d64ddc666 Coding - Apply modernize-* and readability-* clang-tidy checks (#1207)
- Replaces `push_back(T(...))` with `emplace_back(...)` where applicable.
- Replaces `size() == 0` / `size() != 0` checks with `empty()` / `!empty()`.
- Simplifies trivial constructors/destructors to `= default` and removes redundant `(void)` parameter lists.
2026-04-28 20:01:47 +01:00
Pasukhin Dmitry 200d1d0b2f Moding - Update BRep Graph permission usage (#1242)
- Replaced many direct field writes in tests with `EditorView` typed setters and `GenOps::RemoveRef`, and updated mutation-gen tests to use `MarkDirty()`.
- Added incremental reverse-index bind/unbind helpers in `BRepGraphInc_ReverseIndex` and updated editor operations to maintain the reverse index without full rebuilds in many cases.
- Extended `BRepGraph_Copy`/`BRepGraph_Transform` to `CopyNode`/`TransformNode`, adding optional mesh-copy/transform support and new coverage tests.
2026-04-28 19:54:52 +01:00
Pasukhin Dmitry 051b12466a Coding - Update deprecated macros for aliases (#1241)
- Added `Standard_DEPRECATED_STD(...)` to `Standard_Macro.hxx`, expanding to the standard `[[deprecated("...")]]` attribute (or empty when `OCCT_NO_DEPRECATED` is defined).
- Replaced `Standard_DEPRECATED(...)` with `Standard_DEPRECATED_STD(...)` in multiple `GCE2d_*` alias headers to keep deprecation warnings while restoring compiler compatibility.
2026-04-28 16:24:49 +01:00
Pasukhin Dmitry aaa82fc4de Modeling - Fix stack overflow and edge multiplication in shape healing with shared sub-shapes (#1227)
- Add replacement-chain leaf resolution (`ValueLeaf()`), cycle rejection on `Replace()`, and DFS in-flight guards to prevent recursive descent loops.
- Update ShapeFix healing routines to avoid repeated sub-shape re-expansion, add progress cancellation checkpoints, and reduce quadratic wire-fixing cost.
- Add/adjust regression coverage (new GTests; updated existing Draw tests/baselines).
2026-04-28 15:05:42 +01:00
Pasukhin Dmitry bea50c2fd8 Modeling - Tangent case with 2 cylinders (#1228)
2 cylinders are tangent along a line.
The analytical intersection returns a point which is not valid and it is a restriction of the analytical intersection algorithm.
The patch is ensured to use the implicit-implicit intersection algorithm.
2026-04-28 12:50:12 +01:00
Pasukhin Dmitry 048a2927fb Modeling - BRep Graph Builder and Editor clean up (#1237)
- Replace `BRepGraph_Builder::Perform()` with `BRepGraph_Builder::Add()` and introduce `BRepGraph::Clear()` as the rebuild boundary.
- Refactor product/occurrence editing APIs (e.g., `AddAssembly` → `CreateEmptyProduct`, `AddOccurrence` → `LinkProducts`, occurrence mutation via `Editor().Occurrences()`).
- Update a large set of GTests and inline docs to use the new lifecycle and API names.
2026-04-26 15:02:00 +01:00
Pasukhin Dmitry 0804c2b3f9 Testing - Migration QADraw tests to GTests (#1235)
- Removed multiple legacy DRAW test scripts and several QABugs DRAW command implementations.
- Added new GTest suites covering the migrated regressions in ModelingData/ModelingAlgorithms/FoundationClasses/DataExchange/ApplicationFramework.
- Updated multiple `FILES.cmake` lists to compile/link the new tests; introduced an additional `STEPControl_Writer::SetShapeFixParameters()` overload.
2026-04-26 12:22:37 +01:00
Pasukhin Dmitry 90f5d7b214 Coding - Deprecate NCollection_Vector (#1230)
- Updated multiple files to replace instances of NCollection_Vector with NCollection_DynamicArray
2026-04-24 21:47:27 +01:00
Pasukhin Dmitry 7eb211cc2e Modeling - Refactor BRepGraph for uint32_t ids (#1229)
- Migrated node/ref/rep ID types and many count-returning APIs from `int` to `uint32_t`/`size_t` (history indices), updating iterators and bounds checks accordingly.
- Reworked numerous loops from raw integer indexing to typed-id iteration (`Start()`, `IsValid()`, range-for) across core code and tests.
- Expanded compaction test coverage (incl. bounding-box preservation assertion), plus clearer assertions/messages.
2026-04-23 22:09:31 +01:00
Pasukhin Dmitry 0755b6f31d Foundation, Modeling - NCollection modernization and BRepGraph overhaul (#1212)
- Migrate NCollection map/sequence/array size APIs from int to size_t; Size() returns size_t, Length() remains the int accessor; int overloads delegate through NbBucketsFromInt() with a negative-input guard.
- Add NCollection_LinearVector: contiguous flat-buffer dynamic array with Standard::Reallocate-based growth for trivial types and move-construction for non-trivial types.
- Rewrite NCollection_DynamicArray on top of LinearVector<T*>; switch to power-of-two block sizing with precomputed shift/mask.
- Rework NCollection_BaseMap iterator with a forward findFirst() helper (no negative-bucket arithmetic); unify ReSize/BeginResize/EndResize on size_t.
- Enable thread-safe fast path in NCollection_IncAllocator via std::shared_mutex + CAS bump allocation on atomic AvailableSize; exclusive lock is taken only for new-block allocation and list reordering.
- Remove NCollection_BasePointerVector (superseded by NCollection_LinearVector).
- Remove NCollection_BaseMap::Statistics (unused).
- Add <cstddef> include in NCollection_Primes.hxx so size_t resolves on clean builds.
- Document iterator invalidation contract on NCollection_LinearVector.
- Unify BRepGraph programmatic mutation behind EditorView: delete BuilderView (2648+552 lines); EditorView (3186+930 lines) and EditorView_Mut.cxx own both structural creation (Add*/Remove*) and field-level RAII-scoped mutation (Mut*()) with automatic OwnGen and SubtreeGen propagation.
- Add BRepGraph_MeshCache and BRepGraph_MeshView: two-tier mesh storage separating algorithm-derived caches from persistent (definition) triangulations; freshness is keyed on FaceDef.OwnGen; cache writes do not mutate the model.
- Document the MeshCache invalidation contract in BRepGraph_MeshCache.hxx (which mutations bump Face.OwnGen and how markRepModified closes the loop for Surface/Triangulation reps).
- Add BRepGraph_RefsIterator (generic flat ref scan with RefTraits dispatch) and BRepGraph_ReverseIterator (typed parent-traversal wrappers over reverse-index vectors).
- Rework RefId entity model: replace inline refs with typed RefId vectors; add OccurrenceRef and Kind::Occurrence=7; BRepGraphInc_WireExplorer now requires a VertexRefLookup.
- Rename layers for consistency: BRepGraph_ParamLayer to BRepGraph_LayerParam, BRepGraph_RegularityLayer to BRepGraph_LayerRegularity; rename BRepGraphInc_Usage to BRepGraphInc_Instance.
- Replace RootNodeIds() with RootProductIds() returning product roots only.
- Update BRepGraph and BRepGraphInc READMEs; fix stale RootNodeIds reference.
- Sweep Size() to Length() renames across ~200 callers in TKG2d, TKG3d, TKMath, TKMesh, TKBO, TKOffset, TKShHealing, TKTopAlgo, TKBRep, TKService, TKV3d, TKOpenGl, TKMeshVS, TKDE*, TKXCAF, TKXSBase, TKLCAF, TKStd, and Draw harness.
- Add GTest coverage for new containers and the BRepGraph overhaul: NCollection_DynamicArray_Test, NCollection_LinearVector_Test, BRepGraph_Fuzz_Test, BRepGraph_Iterator_Test, BRepGraph_LayerIterator_Test, BRepGraph_MeshCache_Test, BRepGraph_MutGuard_Test, BRepGraph_ReplaceVertex_Test, BRepGraph_ReverseIterator_Test, BRepGraph_ScenarioMatrix_Test, BRepGraph_TypedIdDispatch_Test, BRepGraph_WireExplorer_Test.
2026-04-19 18:47:54 +01:00
Pasukhin Dmitry cf0c71b982 Modeling Data - Fixed possible issue with Explorer (#1195)
Add tests for TopExp_Explorer nested iteration and reinitialization
2026-04-07 18:14:35 +01:00
Pasukhin Dmitry 0af2ccac59 Modeling Data - BRepGraph iterators, ref caching, mutation APIs, and layer events (#1190)
- Add RelatedIterator, CacheKindIterator, LayerIterator, RefTransientCache
- Add Builder::AppendFull, BuilderView::RemoveRef with orphan pruning
- Add SetCoEdgePCurve, ClearFaceMesh, ClearEdgePolygon3D, ValidateMutationBoundary
- Rename CoEdgeDef::Sense to Orientation, FreeChildRefIds to AuxChildRefIds
- Propagate ref-modification events through LayerRegistry (deferred/immediate)
- Extend DefsIterator/RefsIterator with filtered-kind iteration
- Add CreateAutoProduct option to BRepGraphInc_Populate::Options
- Update BRepGraph and BRepGraphInc READMEs
2026-04-05 17:12:48 +01:00
Pasukhin Dmitry a56f2394ce Modeling - Revert changes to original version (#1187)
Refactor GeomBndLib classes for old version of bounding box calculations
Can be fixed later.
- Added new test case for BSplineCurve trimmed range comparison with BndLib.
- Enhanced GeomBndLib_BSplineCurve to handle parameter adjustments for periodic curves.
- Updated GeomBndLib_BSplineCurve2d to improve bounding box calculations.
- Refined GeomBndLib_BSplineSurface to use grid sampling for bounding box determination.
- Optimized GeomBndLib_BezierCurve and GeomBndLib_BezierCurve2d for bounding box calculations.
- Simplified GeomBndLib_SurfaceOfExtrusion and GeomBndLib_SurfaceOfRevolution by leveraging GeomBndLib_OtherSurface for bounding box computations.
- Improved GeomBndLib_Torus to utilize BndLib for bounding box calculations, including handling degenerate cases.
2026-04-05 14:57:53 +01:00
Pasukhin Dmitry a0b30333b1 Coding - Fix warnings in MSVC and refactor deprecations (#1186)
- Added multiple static methods for computing different types of constraints in TPrsStd_ConstraintTools.
- Updated DDocStd_ApplicationCommands to directly assign documents from the document manager.
- Simplified document retrieval in XDEDRAW by directly assigning the document.
- Refactored Bnd_Box and Bnd_Box2d constructors to use default member initializers.
- Improved the FindAllRootsWithDerivativeImpl function by correcting the use of the golden ratio constants.
- Enhanced PerformBounds in IntCurveSurface_Inter by directly assigning the result of SamplePars.
- Refactored ShapeAnalysis_FreeBounds to separate implementation details and improve readability.
- Streamlined GetUKnots and GetTKnots methods in BRepGProp_Face for better clarity and efficiency.
- Updated PreparePolygon in BRepGProp_MeshCinert to return the polygon directly.
- Improved Bnd_Box and Bnd_Box2d methods in GeomBndLib to handle monostate cases correctly.
- Enhanced OpenGl_FrameBuffer methods to safely check for texture availability before accessing size.
2026-04-04 16:39:05 +01:00
Pasukhin Dmitry 0f57a42d89 Coding - Modernize handle APIs and deprecate out-parameter overloads (#1185)
Introduce return-by-value APIs for handle-returning methods across touched toolkits, with nodiscard where appropriate, and keep legacy out-parameter signatures as deprecated wrappers for source compatibility.

- Add new return-by-value overloads for previously output-parameter methods in key classes across ApplicationFramework, DataExchange, ModelingAlgorithms, ModelingData, and Visualization
- Mark legacy output-parameter methods as deprecated and route them through the new overloads
- Update call sites to use the new APIs and simplify temporary-variable patterns
- Extend method documentation in OCCT Doxygen style with param/return sections and deprecation guidance
- Apply const-correctness updates for read-only handle arguments in STEP reader related interfaces
- Preserve compatibility for deprecated public wrappers by keeping exported out-of-line definitions where needed
- Perform minor cleanup of comments and parameter naming consistency

No functional behavior change is intended; this is an API modernization and migration-facilitation update.
2026-04-04 12:09:46 +01:00
Pasukhin Dmitry c765cb4bd2 Modeling - New BRrep Graph representation (#1166)
Implement new representation of topology and BRep into OCCT.
New foundation represent 2 levels:
  BRepGraph - public interfaces which making the topology graph representation
  BRepGraphInc - internal structure which represent topology as an incident tables.
The foundation provides basic logic for conversion from TopoDS_Shape to BRepGraph and back.
The foundation provides the iteration and exploring interfaces to travel in both directions on any level of topology.
The internal id type of inc tables is 'int', which is not for long term and can be updated, better to use typed id aliases, even for the iterations, they provide all necessary operators.
The access to the BRepGraph is done using multiple View classes available by methods from main class.
The extensions on graphs is possible with 'Layer' and 'Cache', where first is persistent, second - temporary,
Some basic operations on graph also provided for compact, analyze and copy.
2026-04-03 00:51:20 +01:00
Pasukhin Dmitry ba824c84ef Modeling - Refactor TopExp_Explorer to use NCollection_LocalArray for stack management (#1181)
- Replaced `TopExp_Explorer`’s `NCollection_Vector`-based stack with `NCollection_LocalArray` + explicit stack-top index management.
- Extended `NCollection_LocalArray` to support non-trivial element types using placement-new, move semantics, and explicit destruction.
- Added GTests for `NCollection_LocalArray` covering non-trivial element lifetime and realloc/move scenarios.
2026-04-01 18:09:23 +01:00
Dmitrii Kulikov 797d3259df Modeling - Enhance tolerance handling in IntAna_QuadQuadGeo intersect… (#1176)
- Adds an additional near-parallel criterion based on axis deviation over the cylinder face height `H` (`sinda * H`).
- Introduces a separate (potentially relaxed) linear tolerance used specifically for the `IntAna_IntConicQuad` parallel/endpoint-distance check.
- Routes the updated tolerances into the `IntAna_IntConicQuad` call to avoid false non-parallel classification for small-height faces.
2026-03-31 09:26:33 +01:00
Pasukhin Dmitry 6050988535 Modeling - Optimize span location for non-periodic BSpline curves and surfaces (#1174)
- Added a non-periodic “fast path” in `countSpanSize()` using next-knot boundary comparisons.
- Reused the previously located span in curve/surface grid loops based on cached “span end” knot value.
- Applied the span-reuse optimization to both cached and direct surface evaluation paths.
2026-03-29 10:08:00 +01:00
Pasukhin Dmitry 4ec89df6f5 Modeling - Refactor BRepClass and FaceClassifier Implementation (#1167)
- Migrated `TopClass_FaceClassifier` / `TopClass_Classifier2d` implementations to `.pxx` and updated BRepClass/Geom2dHatch wrappers to use them (removing `_0.cxx` generator glue).
- Updated BRep class helper headers to use header inlines instead of separate `.lxx` files, and added/rewired passive/face classifier implementations.
- Extended `NCollection_DynamicArray` / `NCollection_KDTree` APIs (insert helpers, callback-based range query) and added GTests for the new vector insert operations.
2026-03-23 18:15:04 +00:00
Pasukhin Dmitry 519036936b Modeling - Add new ExtremaPC package (#1168)
- Add `ExtremaPC` package to `TKGeomBase` and register its sources in `ExtremaPC/FILES.cmake`.
- Implement `ExtremaPC` core types + evaluators, including an `ExtremaPC_Curve` aggregator using `std::variant`.
- Add multiple `ExtremaPC_*` GTests and wire them into `TKGeomBase/GTests/FILES.cmake`.
2026-03-23 18:12:57 +00:00
Pasukhin Dmitry de64d3f411 Modeling - Enhance GeomHash classes with configurable tolerances (#1169)
- Added `CompTolerance` and `HashTolerance` fields + constructors to many specific hashers (3D + 2D).
- Updated composite/poly hashers (`GeomHash_CurveHasher`, `GeomHash_SurfaceHasher`, `Geom2dHash_CurveHasher`) to carry tolerances and pass them through to nested hashers.
- Replaced hardcoded tolerances (previously `1e-12`) with the new tolerance members throughout hashing and comparison logic.
2026-03-23 16:55:15 +00:00
Pasukhin Dmitry 4cdb5a89e5 Coding, Warnings - Refactor parameter naming in curve and surface evaluation methods (#1165)
- Standardize `EvalD0/EvalD1/EvalD2/EvalD3/EvalDN` parameter names to `theU` / `theV` (and `theN`, `theNu`, `theNv`) across multiple curve/surface adaptor classes.
- Update method signatures to use `const double` / `const int` (top-level const) and add local aliases where needed to preserve existing internal variable naming.
- Fix MSVC-warning-prone types/usages in `VrmlData_Scene::readLine()` (use `std::streamsize`, `std::ios::iostate`).
2026-03-23 14:22:27 +00:00
Pasukhin Dmitry 3039226f9d Modeling Data - Remove LProp_AnalyticCurInf files and related references (#1159) 2026-03-11 21:10:49 +00:00
Pasukhin Dmitry 5cc7691bbe Coding - Refactor Geom_OffsetSurface evaluators to use references (#1158)
- Updated `Geom_OffsetSurface_UIsoEvaluator` and `Geom_OffsetSurface_VIsoEvaluator` to store a `const Geom_Surface&` and call `Value()` / `D1()` directly.
- Updated `UIso()` / `VIso()` to construct evaluators with `*this` (and removed `occ::handle<Geom_OffsetSurface> me(this)`).
2026-03-10 18:35:07 +00:00
Pasukhin Dmitry 6f6660d0d6 Modeling Data - Unify LProp packages into template classes in TKGeomBase (#1156)
Consolidate duplicated local property computation classes
(GeomLProp_CLProps, Geom2dLProp_CLProps2d, LProp3d_CLProps,
BRepLProp_CLProps, HLRBRep_CLProps and their SLProps counterparts)
into unified C++ template classes GeomLProp_CLPropsBase and
GeomLProp_SLProps with policy-based access (DirectAccess/ToolAccess).

Move LProp, GeomLProp, and GProp packages from TKG2d/TKG3d to
TKGeomBase. Remove Geom2dLProp and LProp3d packages entirely.
Merge Geom2dLProp_CurAndInf2d into GeomLProp_CurAndInf2d.
Preserve backward-compatible type aliases (using declarations)
for all previously existing class names.

Shared algorithm logic extracted into LProp_CurveUtils and
LProp_SurfaceUtils namespaces. 2D curve analysis helpers
(FuncCurExt2d, FuncCurNul2d, NumericCurInf2d) converted to
header-only .pxx implementations under GeomLProp.

Update all dependent code (LocalAnalysis, BRepFill, ChFi3d,
Geom2dHatch, GeomPlate, ProjLib, HLRBRep, DrawTrSurf, etc.)
to use new template instantiations. Migrate GTests from
TKG2d to TKGeomBase with updated class names.
2026-03-10 16:49:55 +00:00
Pasukhin Dmitry fe9a0de8d0 Modeling Data - Modernize LProp .gxx templates into .pxx utilities (#1155)
Replace legacy .gxx generic class templates (LProp_CLProps.gxx,
LProp_SLProps.gxx) with modern C++ .pxx template utilities
(LProp_CurveUtils.pxx, LProp_SurfaceUtils.pxx) using namespaced
template functions and access policies.

Remove obsolete CurveTool/SurfaceTool intermediary classes
(GeomLProp_CurveTool, GeomLProp_SurfaceTool, LProp3d_CurveTool,
LProp3d_SurfaceTool, BRepLProp_CurveTool) that are no longer needed
with the new direct/tool access policy design.

Replace per-instantiation _0.cxx files with standalone .cxx
implementations that delegate to the shared .pxx utilities.

Fix myCN field type from double to int in all CLProps headers
to match SLProps convention and actual usage (values 0 or 4).
Add default member initializers for uninitialized fields
(myCurvature, mySignificantFirstDerivativeOrder, myMinCurv,
myMaxCurv, myMeanCurv, myGausCurv) across all CLProps/SLProps classes.
Fix theSigOrder pass-by-value bug in Tangent/Curvature wrappers.
Fix typos: anUinfium/anVinfium -> anUinfimum/anVinfimum.
2026-03-09 23:29:52 +00:00
Pasukhin Dmitry c4715e0e72 Modeling - Remove GeomProp modules (#1154)
- Deleted GeomProp_Surface, GeomProp_SurfaceAnalysisTools, GeomProp_SurfaceOfExtrusion, GeomProp_SurfaceOfRevolution, and GeomProp_Torus classes along with their implementation files.
- Removed references to the GeomProp module from the CMake package configuration.
2026-03-09 21:03:18 +00:00
Pasukhin Dmitry daded53b66 Modeling Data - Add derivative caching to GeomProp/Geom2dProp evaluators (#1152)
Refactor GeomProp, Geom2dProp, and GeomProp_Surface evaluator systems
to support direct construction from geometry handles without creating
intermediate adaptors, add per-parameter derivative caching, and
optimize type dispatch.

Key changes:

Handle-based construction path:
- All evaluators accept Handle(Geom_Curve)/Handle(Geom2d_Curve)/
  Handle(Geom_Surface) directly, bypassing adaptor creation for
  analytical types (Line, Circle, Plane, etc.)
- Wrapper initialization from handles uses DynamicType() comparison
  (single extraction, == checks) instead of IsKind() virtual walks
- TrimmedCurve/RectangularTrimmedSurface automatically unwrapped to
  basis geometry with optional CurveDomain/SurfaceDomain bounds

Adaptor-based construction path:
- Specialized evaluators accept only specific adaptor types
  (GeomAdaptor_Curve*, Geom2dAdaptor_Curve*, GeomAdaptor_Surface*)
- OtherCurve/OtherSurface accept base adaptor types for unknown
  geometry
- GeomAdaptor dispatch uses GetType() switch/case for direct
  specialized evaluator construction
- GeomAdaptor_TransformedSurface handled by extracting transformed
  adaptor via new public AdaptorSurfaceTransformed() method

Domain structs:
- Add CurveDomain (First, Last) and SurfaceDomain (FirstU, LastU,
  FirstV, LastV) structs to GeomProp and Geom2dProp namespaces
- Stored as std::optional in evaluators, set only for trimmed
  geometry or adaptor-sourced bounds

Derivative caching:
- Add CurveDerivOrder/SurfaceDerivOrder enums and CurveCache/
  SurfaceCache structs using std::variant over ResD1/ResD2/ResD3
- Enum values match variant alternative indices for direct access
- Non-trivial evaluators (BSpline, Bezier, Offset, Other) store
  mutable cache with requested derivative order
- Shared evaluation helpers in CurveAnalysisTools.pxx and
  SurfaceAnalysisTools.pxx eliminate duplication across evaluators
- Degenerate tangent points upgrade cache to D3, reusing cached
  point for neighbor evaluation

Other improvements:
- Simplify Adaptor() to direct myOwnedAdaptor return
- Add GeomAdaptor_TransformedSurface::AdaptorSurfaceTransformed()
  public method
- Improve MathRoot_Multiple robustness: double minimum sampling
  (2*NbSamples, min 20) for better root detection, add
  EffectiveXTolerance() to prevent spurious duplicates, introduce
  derivative-aware FindAllRootsWithDerivativeImpl() with golden
  section extrema detection and Brent/Newton hybrid refinement
- Update Geom2dLProp CurAndInf2d to use GeomProp-based analysis
2026-03-09 12:38:16 +00:00
Pasukhin Dmitry 7341688668 Coding - Update method guards for consistency (#1151)
Used regex:
^//[\s\n\r\t]*[-=~]{3,}[\n\r]*//[\s\n\r\t]*[-~a-z0-9_ =\s\t./><']+[\s\n\r\t]*:[\s\n\r\t]*[-~a-z0-9_:\t\s./><=']*[\s\n\r\t]*//[\s\n\r\t]*[a-z]+[\s\n\r\t]*:[\s\n\r\t]*[-~a-z0-9_\s\t./><=']{0,30}//[\s\n\r\t]*[-=~]{3,}\n*
2026-03-08 08:45:29 +00:00
Pasukhin Dmitry 39db714224 Modeling Data - Migrate BndLib to delegate to GeomBndLib (#1137)
- Replace monolithic switch statements in BndLib_Add3dCurve, BndLib_AddSurface, and BndLib_Add2dCurve with thin wrappers delegating to GeomBndLib_Curve, GeomBndLib_Surface, and GeomBndLib_Curve2d respectively.
- Remove now-dead internal helpers AddGenCurv, AddGenSurf, and BndLib_Box2dCurve. Public BndLib API is preserved unchanged.
- Implement proper BoxOptimal() in GeomBndLib_OffsetSurface: try the analytic equivalent surface first (offset plane -> plane, offset sphere -> sphere), then fall back to OtherSurface PSO sampling for general cases.
- Refactor GeomBndLib_OffsetCurve2d to share exact fast paths for line and circle offsets between Box() and BoxOptimal(), matching the 3D OffsetCurve pattern; BoxOptimal falls back to OtherCurve2d PSO for general curves.
- Update tests to reflect tighter bounds from GeomBndLib delegation.
2026-03-07 17:55:33 +00:00