Commit Graph

7025 Commits

Author SHA1 Message Date
Pasukhin Dmitry d75806d9bd Data Exchange - Fix PMI measurument conversion factor (#1218)
- Extend STEPCAF dimension value conversion to recognize `StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI` and `StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI`.
- Extend regression test `bug33095` to validate scaling of the nominal dimension value between `m` and `mm`.
2026-04-21 20:49:12 +01:00
Dmitrii Kulikov 75d90efe55 Data Exchange - Crash in XSControl_Reader::OneShape() (#1216)
- Allow `TransferRoots()` and `TransferList()` to append null `TopoDS_Shape` results (matching `TransferEntity()` behavior).
- Update `OneShape()` to skip null shapes when building the result compound to avoid a crash.
- Refactor transfer loops / locals (naming, progress scope sizing, `size_t` iteration).
2026-04-21 17:47:53 +01:00
Dmitrii Kulikov 2f3554f981 Data Exchange - Segfault in CheckSRRReversesNAUO (#1215)
- Add null-checks around `SDR->Definition().PropertyDefinition()` before extracting `ProductDefinition()` (both for `rep1`/`pd1` and `rep2`/`pd2`).
2026-04-21 09:56:02 +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 b3ccf20b1c Testing - Windows ARM64 master validation (#1213)
Move Windows ARM64 validation from IR to master
2026-04-19 18:46:19 +01:00
Dmitrii Kulikov 7289db96d3 Foundation Classes - Improved error handling for unit conversion (#1201)
Units_Measurement now prints name of unknown unit if conversion failed.
Units::Convert() now prints name of unknown unit if conversion failed.
Units::Convert() no longer crashes when first unit is unknown.
Updated incorrect descriptions of methods UnitsAPI - non-existing unit type "millimeter" is replaced with "mm".
2026-04-16 15:17:44 +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
dpasukhi 0ebbbedb23 Coding - Bump version to 8.0.0-rc5 V8_0_0_rc5 2026-04-05 21:10:53 +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 edcb315000 Foundation Classes - Missed operators in strings (#1188)
- Added `AssignCat(int/double)` and `Cat(int/double)` overloads to `TCollection_ExtendedString` (plus `operator+=` / `operator+`).
- Added `AssignCat(TCollection_ExtendedString, replaceNonAscii)` and `Cat(...)` to `TCollection_AsciiString`, plus wide-char (`wchar_t*`) append/concat helpers.
- Added/extended GTests validating the new overloads and UTF-8 conversion behavior.
2026-04-05 12:43:24 +01:00
Pasukhin Dmitry 47b7594090 Configuration - Windows GTest setup fix (#1189)
Enhance Google Test integration by adding output directory functions and updating environment variables
2026-04-05 09:44:09 +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 83929118e7 Modeling - Fix segfault in ChFi3d_Builder::IntersectMoreCorner (#1163)
Add null guards for two crash sites in IntersectMoreCorner where
topology map lookups can fail on shapes from prior boolean/chamfer
operations due to stale TShape pointers:

- Move Arcprol null check before cherche_face call (was after it,
  causing misleading exception on null edge argument).
- Add Arcprolbis null check before use in BRep_Tool::Parameter,
  which dereferences null TShape pointer causing segfault.

Both exceptions are caught by ChFi3d_Builder::Compute() and result
in graceful IsDone() == false instead of crash.

Add regression GTests for chamfer after boolean fusion and
sequential chamfer operations.
2026-04-04 10:04:32 +01:00
Pasukhin Dmitry 922935041a Modeling - Fix multiple bugs and add robustness guards in TKGeomAlgo (#1182)
- Fixes several logic errors across intersection / transition / bounding logic (e.g., singularity flag mixups, swapped bounds, off-by-one index handling, wrong tolerance usage).
- Improves robustness against degenerate inputs (e.g., zero-length parameter spans, empty polylines, zero-magnitude gradients) and makes `TopTrans_SurfaceTransition` instance-safe (thread-safe vs. prior static state).
- Adds new GTests covering the fixed behaviors and robustness guards, and wires them into the toolkit test CMake list.
2026-04-03 00:52:41 +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 8d2d8650ca Foundation, Modeling - Fix thread-safety data races for concurrent operations (#1180)
- Refactors `BRepCheck_*` result classes to use an always-present mutex with a parallel-mode guard, and updates the parallel analyzer to use the new locking model.
- Makes multiple Foundation-level globals thread-safe via `std::atomic`, adds mutex-based protection for lazy initialization, and introduces `std::call_once` on Windows host initialization.
- Converts several TKBool global mutable statics to `thread_local` to prevent cross-thread state corruption.
2026-04-02 17:21:35 +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
Pasukhin Dmitry 8a99c3310b Coding - Update migration scripts (#1178)
- Updated the migration runners (`.sh` / `.bat`) to reuse an existing `collected_typedefs.json` instead of generating/removing files in-place.
- Expanded multiple scripts’ file-extension filters to include `.h/.c/.hpp/.cpp` in addition to OCCT-specific extensions.
- Enhanced `replace_typedefs.py` to add/replace `#include` directives based on the collected typedef metadata.
2026-04-01 11:41:30 +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 d9805d2e04 Modeling - Zero-initialize output array in Weights method for valid finite values (#1175)
- Initialize the full `theTabWeights` array to `0.0` at the start of `Weights()` to avoid leaving any cells uninitialized.
- Remove the now-redundant explicit loop that previously zeroed only row 0 up to `myDegree`.
- Clarify the row-0 filling comment for the odd-`NbGaussPoints` case.
2026-03-29 11:15:46 +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
Winfried Holzapfel 1b0c828bdc Visualization - Include transform of shape in sub-owner bounding box (#1164)
- Apply `SelectMgr_SelectableObject` transformation when computing `BndBoxOfSelected()` for selected sub-owners.
- Add Draw Harness regression test for `MeshVS_Mesh` vertex selection with a transformation.
- Add Draw Harness regression test for transformed `TopoDS_Shape` face selection to ensure existing behavior remains correct.
2026-03-27 11:11:06 +00:00
Harish RS 71b50963ea Testing - Add Windows ARM64 build and test support (#1135)
- Introduces new Windows ARM64 jobs in the multi-platform workflow (build, test, retest, gtest).
- Extends composite GitHub actions with a `target-arch` input and adds ARM64 Mesa llvmpipe setup for headless rendering.
- Adjusts architecture reporting (`dversion`) and updates one mesh regression test with ARM64-specific expected values; updates a DE enum definition to avoid an MSVC ARM64 LTCG miscompile.
2026-03-24 10:24:31 +00: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
Pasukhin Dmitry 8ee0d35c96 Testing - Add support for ARM64 architecture (#1149)
- Allow the custom `tcl` vcpkg port to build on Windows ARM64 and map vcpkg architecture to Tcl’s NMAKE build flags.
- Add a `target-arch` input to the composite GitHub Actions used to configure/build OCCT, selecting the correct CMake `-A` architecture and vcpkg triplet.
- Adjust OCCT CMake vcpkg feature list macros to update `VCPKG_MANIFEST_FEATURES` in the current scope.
2026-03-07 17:49:26 +00:00
Pasukhin Dmitry 763931a9f8 Modeling - Cache transformed surfaces and update fillet/grid evaluators (#1147)
Refactor transformed-surface handling to avoid repeated transformations, remove mutable surface access patterns, and align dependent code paths.

- Add cached transformed data in GeomAdaptor_TransformedSurface and rebuild it on ctor/Load/SetTrsf.
- Add explicit original/transformed surface accessors and deprecate legacy GeomSurface() usage.
- Preserve transformed cache state in BRepAdaptor_Surface shallow copy/initialization.
- Expose GeomAdaptor_Surface::ToleranceU()/ToleranceV() and use them in bounded-surface reload.
- Rework ChFi3d bounded surface helper to support both GeomAdaptor_Surface and BRepAdaptor_Surface.
- Replace ChangeSurface()-based usages in fillet code with const surface access.
- Add and register GeomAdaptor_TransformedSurface GTests.
2026-03-07 12:44:06 +00:00
Pasukhin Dmitry 357ae60dd9 Foundation Classes - Add PointSetLib package; deprecate GProp point coud classes (#1140)
Add new PointSetLib package in TKMath providing standalone point cloud analysis without GProp_GProps inheritance:
- PointSetLib_Props: weighted point set properties (mass, barycentre, inertia matrix via Huygens theorem)
- PointSetLib_Equation: PCA-based dimensionality analysis (point, line, plane, space detection) with principal axes and extents accessors

Deprecate legacy GProp point cloud classes:
- GProp_PGProps replaced by using alias to PointSetLib_Props
- GProp_PEquation replaced by using alias to PointSetLib_Equation
- GProp_EquaType enum removed (zero consumers)
- GProp_CelGProps, GProp_SelGProps, GProp_VelGProps marked deprecated

Migrate ShapeAnalysis_Geom::NearestPlane to use PointSetLib_Equation instead of GProp_PGProps + GProp_PrincipalProps.
2026-03-06 16:50:01 +00:00
Pasukhin Dmitry d8683ac97c Modeling Data - Fix GeomEval_TBezierSurface IsCN* override signatures for MSVC (#1145)
Align `GeomEval_TBezierSurface::IsCNu()` and `IsCNv()` declarations/definitions
with `Geom_Surface` by using `const int` parameter type, removing MSVC C4373
warnings treated as errors in `TKG3d` builds.

- update `GeomEval_TBezierSurface.hxx` signatures
- update matching `GeomEval_TBezierSurface.cxx` definitions
2026-03-06 13:12:20 +00:00
Pasukhin Dmitry d13ac1e880 Coding, Application Framework - Clean up files (#1146)
- Replaces old-style function/purpose comment blocks (`//=======...// function: ...// purpose: ...//=======`) with the modern 100-character separator line (`//===...===`) across ~100 files.
- Replaces C-style casts with appropriate C++ casts (`static_cast`, `reinterpret_cast`, `const_cast`) and removes redundant casts throughout the codebase.
- Removes `#ifdef OCCT_DEBUG_*` blocks (dead debug/trace code) and modernizes `TopExp_Explorer` usage from `Init()` style to constructor style, along with adding new GTest files.
2026-03-06 13:12:05 +00:00
Pasukhin Dmitry d07798d521 Modeling Data - Fix continuity order mapping in BRepProp_Curve to match GeomProp_Curve (#1141)
The condition == 2 only matched GeomAbs_C1 curves for D1 evaluation, while >= 2 (as used in GeomProp_Curve::Continuity())
  correctly includes GeomAbs_G2 and higher, since G2 implies G1 which guarantees D1 exists.
2026-03-06 08:09:40 +00:00
Pasukhin Dmitry 51ab458dbd Modeling Data - Introduce GeomAdaptor_TransformedCurve and unify Eval-based evaluation API (#1139)
Add GeomAdaptor_TransformedCurve as a new base class for BRepAdaptor_Curve that wraps a GeomAdaptor_Curve (or Adaptor3d_CurveOnSurface) with an applied gp_Trsf transformation. This mirrors the existing GeomAdaptor_TransformedSurface pattern for curves.

Refactor the adaptor evaluation API across Adaptor3d_Curve and Adaptor3d_Surface hierarchies so that EvalD0/D1/D2/D3/DN are the primary virtual evaluation methods:

- Adaptor3d_Curve: Value, D0-DN become non-virtual inline wrappers delegating to EvalD*. Base EvalD* implementations now throw Standard_NotImplemented instead of calling D*.
- Adaptor3d_Surface: same pattern applied symmetrically.
- Adaptor3d_CurveOnSurface: removes Value/D0-DN overrides (inherited from base); adds EvalD0/D1/D2/D3/DN marked final with the full dispatch logic.
- Adaptor3d_IsoCurve: removes Value/D0-DN overrides; adds EvalD* final with iso-curve projection logic (IsoU selects D1V/D2V/D3V, IsoV selects D1U/D2U/D3U).
- GeomAdaptor_Curve: removes Value/D0-DN overrides (now inherited inline); EvalD* remain final with BSpline cache and analytical dispatch logic.
- GeomAdaptor_Surface: removes Value/D0-DN overrides (now inherited inline); EvalD* remain final with BSpline cache and analytical dispatch logic.
- GeomAdaptor_TransformedCurve: overrides EvalD* with transform-and-dispatch logic; no need to override Value/D0-DN (inherited from Adaptor3d_Curve).
- GeomAdaptor_TransformedSurface: removes Value/D0-DN overrides (now inherited inline).
- BRepAdaptor_Curve: refactored to inherit GeomAdaptor_TransformedCurve, removing all duplicated evaluation and geometry-extraction method implementations.
- BRepAdaptor_CompCurve: removes Value/D0-DN overrides; adds EvalD* final with compound-curve parameter mapping and derivative scaling logic.
- ProjLib_ProjectOnPlane: removes Value/D0-DN overrides; adds EvalD* final delegating to the projected result adaptor or the OnPlane_* free functions.
- GeomFill_SnglrFunc: removes Value/D0-DN overrides; adds EvalD* final implementing the C'(t) x C''(t) singular function with ratio scaling.
- ChFiDS_ElSpine: removes Value/D0-D3 overrides; adds EvalD0-D3 final delegating to the internal GeomAdaptor_Curve member.
- BiTgte_CurveOnEdge: removes Value/D0-DN overrides; adds EvalD* final.
- BiTgte_CurveOnVertex: removes Value/D0-DN overrides; adds EvalD* final (D1-DN throw Standard_NotImplemented as the curve represents a degenerate point).
- HelixGeom_HelixCurve: removes Value/D0-D2/DN overrides; adds EvalD0/D1/D2/DN final with trigonometric helix evaluation.

Add GTest coverage for GeomAdaptor_TransformedCurve: point/derivative evaluation with transformation, curve-on-surface path, GeomGridEval_Curve batch evaluation.
2026-03-05 10:35:15 +00:00
Pasukhin Dmitry 96028bae5f Coding - Harmonize GC/gce maker APIs and documentation (#1130)
Refactor TKGeomBase GC/gce maker classes to improve consistency,
header-level readability, and generated API docs.

- GC:
  - Expanded and standardized class/method Doxygen descriptions.
  - Added missing @param/@return tags and clarified @note sections.
  - Inlined GC_Root status helpers in header and removed GC_Root.lxx.
  - Updated GC/FILES.cmake accordingly.

- gce:
  - Expanded and standardized class/method Doxygen descriptions.
  - Added missing @param/@return tags and clarified error/status notes.
  - Inlined trivial operator wrappers in headers and removed redundant
    out-of-line operator implementations from *.cxx files.
  - Kept Value() as checked API returning const reference.
  - Updated Operator()/conversion operators to return copies, while
    delegating through Value() to preserve StdFail_NotDone checks.
  - Inlined gce_Root status helpers in header and removed gce_Root.lxx.
  - Updated gce/FILES.cmake accordingly.
  - Refined documentation text in gce_ErrorType and gce_Root.

No geometric construction algorithms were changed; this is API/documentation
and wrapper-structure cleanup with behavior-preserving status checks.
2026-03-04 15:27:41 +00:00
Pasukhin Dmitry cbc7f776a6 Modeling Data - Add GeomBndLib package for geometry-aware bounding box computation (#1136)
Add a new package GeomBndLib to TKGeomBase implementing fast and optimal
bounding box computation for all standard Geom curve and surface types.
GeomBndLib replaces the monolithic BndLib switch-based approach with a
per-type class hierarchy and std::variant-based dispatch, and fixes several
accuracy regressions present in BndLib.

Architecture:

- GeomBndLib_Curve / GeomBndLib_Curve2d / GeomBndLib_Surface:
  Public dispatcher classes built on std::variant over all specialized
  evaluators. Expose both Box/BoxOptimal (return Bnd_Box by value, RVO)
  and Add/AddOptimal (mutate Bnd_Box& for drop-in BndLib compatibility).
  Type detection and handler construction are performed once at construction
  time; dispatch is a single std::visit call with no virtual overhead.

Specialized 3D curve evaluators:

- GeomBndLib_Line: analytic axis-aligned interval, inline header-only.
- GeomBndLib_Circle: analytic arc bounding box for arbitrary gp_Circ and
  parameter range; static Box() used internally by surface evaluators.
- GeomBndLib_Ellipse / GeomBndLib_Hyperbola / GeomBndLib_Parabola:
  analytic extremum computation for conic sections over arbitrary arcs.
- GeomBndLib_BezierCurve: single FillBox span with convex hull reduction.
- GeomBndLib_BSplineCurve: knot-span FillBox with weakness-scaled deflation
  and convex hull reduction. Non-periodic partial ranges use BSplCLib::Hunt
  to select the contributing pole index range directly, avoiding Copy() and
  Segment() allocation. Periodic partial ranges use Segment() on a copy
  with the correct segmented poles passed to ReduceSplineBox. BoxOptimal
  uses grid sampling combined with per-coordinate Powell minimization.
- GeomBndLib_OffsetCurve: delegates to the basis curve evaluator and
  enlarges by the offset magnitude.
- GeomBndLib_OtherCurve: grid sampling with per-coordinate Powell
  minimization for general curve types.

Specialized 2D curve evaluators (GeomBndLib_*2d):

- Mirror of the 3D evaluators for Geom2d curves and Bnd_Box2d.
  GeomBndLib_BSplineCurve2d applies the same Hunt-based partial-range
  optimization as the 3D counterpart.

Specialized surface evaluators:

- GeomBndLib_Plane: analytic corner-based box for planar patches, inline.
- GeomBndLib_Sphere: analytic extremum on axis-aligned sphere, exact for
  full sphere and arbitrary patches.
- GeomBndLib_Cylinder / GeomBndLib_Cone: circle-arc bounding box at
  extremal V-parameter positions.
- GeomBndLib_Torus: circle-arc bounding boxes at PI/4 V-boundary positions
  for fast Box(); PSO + Powell via GeomBndLib_OtherSurface for BoxOptimal().
  Resolves a regression in BndLib where the Torus AddOptimal case was
  missing from the switch and fell through to AddGenSurf, which converged
  to an incorrect result for tilted tori.
- GeomBndLib_BezierSurface: pole convex hull for full-range queries; grid
  sampling fallback for trimmed patches.
- GeomBndLib_BSplineSurface: pole convex hull with per-direction index
  selection via BSplCLib::Hunt (no surface copy or segment); grid sampling
  fallback for out-of-bounds parameters. BoxOptimal uses fine grid sampling
  combined with per-coordinate PSO + Powell minimization.
- GeomBndLib_SurfaceOfRevolution: circle-arc bounding boxes at PI/4
  V-boundary positions; degenerate (axis-on-surface) and infinite cases
  handled analytically via GeomBndLib_InfiniteHelpers.
- GeomBndLib_SurfaceOfExtrusion: extruded arc box added with the extrusion
  direction contribution; degenerate and infinite cases handled analytically.
- GeomBndLib_OffsetSurface: delegates to equivalent surface when available,
  otherwise conservative basis-box enlarged by |offset|.
- GeomBndLib_OtherSurface: PSO + Powell numerical optimization for general
  surface types; used directly by Torus and OffsetSurface BoxOptimal paths.

Internal helpers (private .pxx, not part of the public API):

- GeomBndLib_SplineHelpers: FillBox (knot-span sampler returning maximum
  chord deflection), ReduceSplineBox (convex hull intersection), indexed
  ReduceSplineBox overload for pole subset ranges, and
  ComputePoleIndexRange (BSplCLib::Hunt-based pole index selection shared
  by curve and surface evaluators).
- GeomBndLib_OptimizationHelpers: AdjustExtrCurve / AdjustExtrCurve2d /
  AdjustExtrSurf implementing Powell minimization seeded from a PSO pass
  for tight BoxOptimal results.
- GeomBndLib_SamplingHelpers: ComputeNbSamples / ComputeNbUSamples /
  ComputeNbVSamples providing consistent sample counts across all evaluators.
- GeomBndLib_InfiniteHelpers: open/infinite interval handling for surfaces
  of revolution and extrusion.

Tests:

- GeomBndLib_Curve_Test: 3D curve dispatching, all analytic types, BSpline
  and Bezier full and partial ranges, periodic curves, offset curves.
- GeomBndLib_Curve2d_Test: 2D curve dispatching, all analytic types, BSpline
  and Bezier full and partial ranges, offset curves.
- GeomBndLib_Surface_Test: surface dispatching, all analytic types including
  tilted and degenerate cases, Torus BoxOptimal vs analytic reference.
- GeomBndLib_OffsetCurve_Test: offset curve bounding box correctness and
  BoxOptimal precision for 3D cases.
- GeomBndLib_OffsetCurve2d_Test: same for 2D offset curves.
- GeomBndLib_OffsetSurface_Test: offset surface Box and conservative fallback.
- GeomBndLib_SurfaceOfRevolution_Test: full and partial revolution surfaces,
  degenerate and infinite cases.
- GeomBndLib_SurfaceOfExtrusion_Test: straight and BSpline extrusions,
  diagonal extrusion direction, infinite cases.
2026-03-04 14:18:38 +00:00
Pasukhin Dmitry ae7e259e17 Foundation Classes - align modern Math* APIs with legacy math_* behavior (#1134)
MathLin:
- Return full matrix solutions for multi-RHS APIs.
- Add LinearMultipleResult for matrix RHS solve results.

MathSys:
- Fix Newton2D/3D/4D tiny-step exit logic: re-check residual at updated point and return OK when converged.

MathUtils / MathInteg:
- Add modern Gauss points/weights implementation in MathUtils_Gauss.cxx.
- Keep legacy-table parity for orders 1..61 and compute fallback for higher orders.
- Make GaussAdaptive use IntegConfig InitialOrder/MaxOrder with bounds validation.
- Propagate ordered Gauss points/weights retrieval failures in set/multiple integration.
- Extend BracketMinimum API with bounded/options-based behavior.

Tests:
- Extend MathLin, MathSys and MathInteg tests for new behavior and regressions.
- Add MathUtils bracketing tests.
- Add MathLin_EigenSearch parity test coverage against legacy solver.

Documentation:
- Update MathLin/MathInteg/MathUtils READMEs to match current APIs and behavior.
2026-03-03 14:18:18 +00:00
luzpaz 33688d1049 Documentation - Fix typos (#1132) 2026-03-03 08:16:13 +00:00
Pasukhin Dmitry 1cc42af8d6 Modeling Algorithms - Add Gordon surface construction from curve networks (#1131)
Add GeomFill_Gordon and GeomFill_GordonBuilder classes implementing Gordon surface (transfinite interpolation) construction via the Boolean sum formula: S = S_profiles + S_guides - S_tensor.

GeomFill_GordonBuilder is the low-level kernel accepting pre-compatible BSpline curves with known intersection parameters. GeomFill_Gordon is the high-level wrapper handling arbitrary Geom_Curve inputs, automatic intersection detection, network sorting/orientation, approximation-based reparametrization with kink preservation, scale-relative tolerances, closedness detection, and OSD_Parallel acceleration.

Add Approx_BSplineApproxInterp class implementing constrained least-squares B-spline approximation with exact interpolation constraints via a KKT saddle-point system, used internally by the reparametrization pipeline.

45 GTests covering both classes validate bilinear through 6x6 networks, reversed/shuffled inputs, scaled geometry, surface continuity, and the Boolean sum mathematical property.
2026-03-03 08:14:03 +00:00
Pasukhin Dmitry c540f316ba Modeling - Improve memory management in BOPAlgo_PaveFiller::MakeBlocks (#1044)
This change improves allocator usage in Boolean operations to reduce memory accumulation and make allocator choices explicit.

BOPAlgo_PaveFiller_6.cxx:
- Add aDefaultAllocator for collections requiring proper Free() behavior
- aMVTol, aLPB, aDMVLV now use default allocator (have Remove/UnBind ops)
- aMPBCommon now uses aTmpAllocator (was missing allocator)
- Cross-iteration collections now explicitly use aAllocator
- Add comments explaining allocator choice rationale

BOPDS_DS.cxx:
- SubShapesOnIn() now uses const references instead of copying 4 IndexedMaps
- This eliminates unnecessary memory allocations per face-face intersection
2026-03-01 13:19:39 +00:00