Commit Graph

130 Commits

Author SHA1 Message Date
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
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
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
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
6606bc75af Modeling Data - Harden geometry builders and add regression GTests (#1129)
Improve robustness and status handling across TKGeomBase construction code and extend unit coverage for boundary/degenerate cases.

Code changes:
- gce_MakeCone:
  - fix perpendicular direction fallback branches
  - implement gp_Cone + gp_Pnt / gp_Cone + Dist constructors
  - add defensive radius handling and semi-angle cosine guard
- gce_MakeCylinder:
  - fix perpendicular direction fallback branches
- GCE2d_MakeCircle, GC_MakePlane:
  - propagate status from delegated gce builders instead of forcing Done
- GC_MakeArcOfCircle:
  - replace hardcoded tolerance with Precision::Confusion()
- GCE2d_MakeSegment:
  - replace exact zero checks with gp::Resolution()-based checks
- gce_MakeCirc2d:
  - migrate to gp::Resolution() and remove boundary overlap in branch setup
- gce_MakeElips, gce_MakeHypr:
  - add explicit near-zero cross-product guards before gp_Dir construction
- ProjLib_Cone:
  - replace exact x/y zero check with angular tolerance
  - document tolerance intent for atan2 stability
- ProjLib_ComputeApproxOnPolarSurface:
  - replace period != 0.0 checks with Precision::PConfusion()
- ElCLib:
  - replace Focal == 0.0 checks with abs(Focal) <= gp::Resolution()

Tests:
- add new TKGeomBase GTests for:
  - gce_MakeCone, gce_MakeCylinder, gce_MakeCirc2d, gce_MakeElips
  - GCE2d_MakeCircle, GCE2d_MakeSegment
  - GC_MakePlane, GC_MakeArcOfCircle, GC_MakeConicalSurface
  - ProjLib_Cone, ProjLib_ComputeApproxOnPolarSurface
- extend ElCLib tests with near-zero and above-threshold parabola focal cases
2026-02-28 15:49:14 +00:00
Pasukhin Dmitry
00eadd4098 Modeling Data, AdvApp2Var - Reorganize private data/init code, modernize legacy types (#1127)
- Replace public-style data header with private `AdvApp2Var_Data.pxx` aggregation and rename data fragments to dedicated `AdvApp2Var_Data_*.pxx` files.
- Remove obsolete `AdvApp2Var_Data_f2c.hxx` and migrate legacy Fortran typedef/macro usage to native C++ types and standard helpers.
- Merge static initialization logic into main compilation units (`AdvApp2Var_MathBase.cxx`, `AdvApp2Var_SysBase.cxx`) and drop separate init sources.
- Remove unused SysBase legacy entry points and apply readability cleanup in AdvApp2Var internals.
- Add per-file GTests (`AdvApp2Var_Context_Test`, `AdvApp2Var_Framework_Test`, `AdvApp2Var_Iso_Test`, `AdvApp2Var_Network_Test`, `AdvApp2Var_Node_Test`) and update package/GTests `FILES.cmake`.
2026-02-27 21:48:34 +00:00
Pasukhin Dmitry
2ce7b26ddb Coding - Standardize comment separators, translate French comments (#1126)
Normalize method separator lines across the codebase to exactly
100 characters (// followed by 98 = signs) matching the project
coding standard.

Translate remaining French comments to English in ModelingData
packages (TKBRep, TKG2d, TKG3d, TKGeomBase) and FoundationClasses.

Add [[nodiscard]] attribute to Copy() methods on Geom_Geometry,
Geom2d_Geometry, Geom_Transformation, and Geom2d_Transformation
to prevent accidental discard of returned handles.

Fix typo in AppDef_Variational::Dump() debug output: "Nombre of
3d par multipoint" -> "Number of 3d per multipoint".

Update .github/copilot-instructions.md separator examples to match
the corrected convention.
2026-02-27 12:34:21 +00:00
Loke Strøm
d7abd72eac Modeling, Hyperbola - Fixing over constraining direction errors (#1100)
- Removed `gce_InvertAxis` and `gce_InvertRadius` error checks from hyperbola constructors
- Added collinear point validation to the 3-point constructors
- Updated documentation to reflect the correct validation rules
2026-02-27 08:39:14 +00:00
Pasukhin Dmitry
c9ecf72850 Modeling Data - Extend Prop packages with per-type GTests and shared tools (#1125)
Extract duplicated curve analysis logic (tangent, curvature, normal,
centre of curvature, inflection/extrema finding) from per-type evaluators
(BezierCurve, BSplineCurve, OffsetCurve, OtherCurve) into shared
CurveAnalysisTools.pxx for both GeomProp (3D) and Geom2dProp (2D).

Add GeomProp::ComputeTangent overload with sign correction using
finite-difference points, and use it in BRepProp_Curve::Tangent to
properly handle degenerate D1 cases instead of falling back to
unsigned higher-order derivatives.

Add GeomProp_Curve::Continuity static methods for computing junction
continuity (C0/G1/C1/C2) between two Geom_Curve handles, with BSpline
knot-multiplicity analysis and optional orientation reversal flags.

Add 29 per-geometry-type GTest files (9 3D curves, 9 2D curves,
11 3D surfaces) covering:
- Analytical property verification against known formulas
- VsCLProps/VsCLProps2d/VsSLProps comparison with legacy LProp APIs
  at both uniform samples and critical points (vertices, poles, knots,
  seams, endpoints, near-degenerate regions)
- FindCurvatureExtrema/FindInflections validation where applicable

Update existing VsCLProps, VsCLProps2d, VsSLProps, and VsBRepLProp
comparison tests with improved structure and broader coverage.
2026-02-26 22:33:27 +00:00
Pasukhin Dmitry
180906866e Modeling Data - Update hardcoded AppCont_ContMatrices (#1117)
- Replaced old AppCont_ContMatrices.hxx/.cxx public interface with internal namespace-based .pxx header structure
- Split legacy matrix data into separate internal headers (BB, InvM, IBP, IBT, VB) for better organization
- Fixed out-of-bounds read in IBPMatrix for classe=26 by adding 3 missing data entries
- Added comprehensive GTest suite with 9 tests covering all matrix functions and their mathematical properties
2026-02-25 20:39:31 +00:00
Pasukhin Dmitry
12b54504ee Modeling Data - Enforce construction-time initialization for Prop and GridEval classes (#1118)
Replace two-step initialization (default constructor + Initialize) with
direct construction for 8 non-copyable/non-movable property and grid
evaluator classes. Objects are now always in a valid state after construction.

Refactored classes:
- GeomProp_Curve, GeomProp_Surface (TKG3d)
- Geom2dProp_Curve (TKG2d)
- BRepProp_Curve, BRepProp_Surface (TKBRep)
- GeomGridEval_Curve, GeomGridEval_Surface (TKG3d)
- Geom2dGridEval_Curve (TKG2d)

Changes per class:
- Remove default constructor and IsInitialized() method.
- Add constructors matching each former Initialize overload.
- Rename Initialize to protected initialization method for internal
  and derived class use.

All callers updated across production code (Extrema, BndLib,
IntCurveSurface, IntPatch, HLRBRep, GeomGridEval derived classes)
and test files to use constructor-based initialization.
2026-02-25 15:06:57 +00:00
Pasukhin Dmitry
33ef11ca53 Modeling Data - Add BRepProp package for modern BRep differential properties (#1116)
Add new BRepProp package to TKBRep as a thin wrapper over GeomProp:: free
functions for computing local differential properties of BRep edges and faces
without exceptions. Replaces the legacy BRepLProp macro-based (.gxx) pattern.

New package BRepProp (TKBRep) provides:
- BRepProp_Curve: Local curve property evaluator for BRep edges.
  Delegates derivative computation to BRepAdaptor_Curve and passes results
  to GeomProp::ComputeTangent, ComputeCurvature, ComputeNormal,
  ComputeCentreOfCurvature. Three Initialize overloads: from TopoDS_Edge
  (owning), from BRepAdaptor_Curve reference (non-owning), and from
  occ::handle<BRepAdaptor_Curve> (shared ownership). Includes static
  Continuity() methods for regularity analysis at curve junctions
  (replaces BRepLProp::Continuity).
- BRepProp_Surface: Local surface property evaluator for BRep faces.
  Delegates derivative computation to BRepAdaptor_Surface and passes results
  to GeomProp::ComputeSurfaceNormal, ComputeSurfaceCurvatures,
  ComputeMeanGaussian. Same three Initialize overloads as BRepProp_Curve.

Key design decisions:
- No variant dispatch needed: BRepAdaptor_Curve/Surface handle geometry-type
  dispatch internally via virtual methods, so BRepProp is a thin wrapper
  calling adaptor D1/D2/D3 then GeomProp:: free functions.
- Ownership pattern: occ::handle for owning case + raw const pointer for
  non-owning case, consistent with GeomProp_Curve/Surface.
- Returns result structs with IsDefined flags instead of throwing exceptions.

18 GTests: 11 unit tests (line, circle, box, cylinder, sphere) and
7 cross-validation tests against BRepLProp_CLProps/BRepLProp_SLProps.
2026-02-24 22:19:34 +00:00
Pasukhin Dmitry
55db67c60d Modeling Data - Add GeomProp package for modern 3D curve and surface differential properties (#1115)
Add new GeomProp package to TKG3d following the same C++17 std::variant-dispatched
pattern as Geom2dProp (TKG2d) for computing local differential properties
of 3D curves and surfaces without exceptions.

New package GeomProp (TKG3d) provides:
- GeomProp: Result structs (TangentResult, CurvatureResult, NormalResult,
  CentreResult, CurveAnalysis for curves; SurfaceNormalResult,
  SurfaceCurvatureResult, MeanGaussianResult for surfaces) and
  geometry-agnostic free functions for property computation from derivatives.
- GeomProp_Curve: Unified variant dispatcher that auto-detects curve type
  from Geom_Curve or Adaptor3d_Curve and delegates to specialized evaluators.
  Owns the GeomAdaptor_Curve handle and passes non-owning raw pointers to
  per-geometry classes.
- GeomProp_Surface: Unified variant dispatcher that auto-detects surface type
  from Geom_Surface or Adaptor3d_Surface and delegates to specialized evaluators.
  Owns the GeomAdaptor_Surface handle with non-owning raw pointers.
- Per-geometry curve evaluators (9 types matching GeomAbs_CurveType):
  Line (header-only), Circle (header-only), Ellipse, Hyperbola, Parabola,
  BezierCurve, BSplineCurve, OffsetCurve, OtherCurve.
- Per-geometry surface evaluators (11 types matching GeomAbs_SurfaceType):
  Plane (header-only), Cylinder (header-only), Sphere (header-only),
  Cone, Torus, BezierSurface, BSplineSurface, SurfaceOfRevolution,
  SurfaceOfExtrusion, OffsetSurface, OtherSurface.
- Surface curvatures computed via first/second fundamental forms with
  correct sign convention consistent with surface normal orientation.
  Principal directions derived from the shape operator (Weingarten map).

48 GTests covering free functions, curve/surface dispatchers,
cross-validation against GeomLProp_CLProps (8 curve types) and
GeomLProp_SLProps (6 surface types).
2026-02-24 18:51:11 +00:00
Pasukhin Dmitry
3266a82318 Modeling Data - Add Geom2dProp package for modern 2D curve differential properties (#1113)
Replace archaic LProp/Geom2dLProp macro-based (.gxx) pattern with a modern C++17 std::variant-dispatched package for computing local differential properties of 2D curves: tangent, curvature, normal, centre of curvature, curvature extrema, and inflection points.

New package Geom2dProp (TKG2d) provides:
- Geom2dProp: Result structs (TangentResult, CurvatureResult, NormalResult, CentreResult, CurveAnalysis) and geometry-agnostic free functions for property computation from derivatives.
- Geom2dProp_Curve: Unified variant dispatcher that auto-detects curve type from Geom2d_Curve or Adaptor2d_Curve2d and delegates to specialized evaluators. Owns the Geom2dAdaptor_Curve handle and passes non-owning raw pointers to per-geometry classes.
- Per-geometry evaluators with optimized evaluation:
  - Line (header-only): zero curvature, constant tangent
  - Circle (header-only): constant curvature 1/R
  - Ellipse: analytical extrema at 0, PI/2, PI, 3PI/2
  - Hyperbola: analytical extremum at vertex
  - Parabola: analytical extremum at vertex
  - BezierCurve: numeric curvature extrema/inflection finding
  - BSplineCurve: numeric with C3 interval subdivision
  - OffsetCurve: numeric approach
  - OtherCurve: fallback via adaptor virtual D1/D2/D3

Key design decisions:
- Uses Geom2dAdaptor_Curve for optimized derivative evaluation (D0-DN) with BSpline span caching.
- Non-owning raw pointers in per-geometry classes; lifetime managed by the Geom2dProp_Curve dispatcher which holds the adaptor handle.
- Returns result structs with IsDefined flags instead of throwing exceptions for degenerate cases.
- 106 GTests covering all curve types, free functions, adaptor/geometry initialization, trimmed curves, cross-validation against LProp.
2026-02-24 17:10:36 +00:00
Pasukhin Dmitry
9ee9dc02a4 Modeling Data - Fix IsClosed/IsPeriodic tolerance and add TKG2d GTests (#1109)
IsClosed() methods across curve and surface classes used gp::Resolution() (~1e-290) for point distance comparison, making the check practically unusable for floating-point evaluated points. Replaced with Precision::Computational() (~DBL_EPSILON) which correctly represents machine-precision arithmetic equality.

TrimmedCurve (2D/3D) and RectangularTrimmedSurface IsClosed() and IsPeriodic() now detect when the trim spans an integer multiple of the basis geometry period using std::remainder(), instead of unconditionally returning false for trimmed parametric ranges.

Added 17 new GTest files (271 tests) for TKG2d covering previously untested packages: Adaptor2d, Geom2dLProp, LProp, and fundamental Geom2d classes (Circle, Ellipse, Line, Hyperbola, Parabola, TrimmedCurve, Transformation, VectorWithMagnitude, Direction, CartesianPoint, AxisPlacement).

IsClosed() tolerance fix applied to:
- Geom2d_TrimmedCurve, Geom_TrimmedCurve
- Geom2d_BSplineCurve, Geom_BSplineCurve
- Geom2d_OffsetCurve, Geom_OffsetCurve

IsPeriodic() / IsUPeriodic() / IsVPeriodic() fix applied to:
- Geom2d_TrimmedCurve, Geom_TrimmedCurve
- Geom_RectangularTrimmedSurface (also IsUClosed/IsVClosed)
2026-02-24 15:34:22 +00:00
Pasukhin Dmitry
95b2c6ee3e Modeling Data - Optimize evaluation of derivatives in GeomEval_TBezierSurface (#1114)
- Extract common subexpressions in `EvalD2` (6 intermediate products) and `EvalD3` (10 intermediate products) to avoid redundant multiplications
- Improve inline comments to include explicit formulas for derivative computations
2026-02-24 15:11:04 +00:00
Pasukhin Dmitry
e8012824d6 Modeling Data - Remove TColGeom2d and TColGeom packages (#1110) 2026-02-23 17:41:02 +00:00
Pasukhin Dmitry
a816f8a30e Modeling Data - Add Eval geometry classes and integrate EvalRep dispatch (#1104)
Introduce new evaluation-focused geometry classes in TKG2d/TKG3d:

- Geom2dEval_AHTBezierCurve
- Geom2dEval_TBezierCurve
- Geom2dEval_SineWaveCurve
- Geom2dEval_ArchimedeanSpiralCurve
- Geom2dEval_LogarithmicSpiralCurve
- Geom2dEval_CircleInvoluteCurve
- GeomEval_AHTBezierCurve
- GeomEval_TBezierCurve
- GeomEval_SineWaveCurve
- GeomEval_CircularHelixCurve
- GeomEval_AHTBezierSurface
- GeomEval_TBezierSurface
- GeomEval_CircularHelicoidSurface
- GeomEval_EllipsoidSurface
- GeomEval_HyperboloidSurface
- GeomEval_ParaboloidSurface
- GeomEval_HypParaboloidSurface

Move and rename EvalRep descriptors/utilities to Geom2dEval/GeomEval
packages and wire EvalRep dispatch into Geom2d/Geom entities and adaptor
EvalD* paths.

Harden Eval API contracts by throwing Standard_NotImplemented for unsupported
operations (Reverse/ReversedParameter, U/VReverse/U/VReversedParameter,
Transform, UIso/VIso where applicable). Align behavioral checks and invariants,
including non-periodic sine-wave behavior and stricter parameter validation
(e.g. hyperboloid radii).
2026-02-23 12:44:45 +00:00
Pasukhin Dmitry
e384f0bb93 Testing - Add unit tests for geometric classes and conversions (#1099)
- Introduced new tests for TopExp class to validate shape mapping and vertex retrieval.
- Added tests for Geom_Circle, Geom_Line, and Geom_Plane classes to ensure correct geometric behavior and transformations.
- Implemented tests for GCPnts_AbscissaPoint to verify length calculations and parameter retrieval for lines and circles.
- Created conversion tests in GeomConvert to check the accuracy of converting geometric entities to B-spline representations.
- Updated CMake files to include new test files for the added tests.
2026-02-20 20:25:09 +00:00
Pasukhin Dmitry
48ebca0f70 Modeling Data - Remove std::optional from EvalD* evaluation API (#1094)
Replace std::optional return types with direct returns and exception-based
error handling in Geom/Geom2d/Surface EvalD0/D1/D2/D3/DN methods to avoid
performance overhead of std::optional wrapping on the hot evaluation path.

Changes:
- EvalD* methods now return result structs directly instead of
  std::optional<T>, throwing Geom_UndefinedValue/Geom_UndefinedDerivative
  on failure
- D0/D1/D2/D3/DN inline wrappers simplified to unpack direct returns
  instead of checking optional validity
- TryEval* helper functions in EvalRepUtils converted from
  std::optional<T> returns to bool + output parameter pattern
- Adaptor classes (Adaptor3d_Curve/Surface, Adaptor2d_Curve2d,
  GeomAdaptor_Curve/Surface, Geom2dAdaptor_Curve) simplified by
  removing try-catch wrappers around evaluation calls
- Removed dead #include <optional> from 5 header files
- Updated GTests to match new direct-return API
2026-02-15 17:41:13 +00:00
Pasukhin Dmitry
13d6dfc2e7 Modeling Data - Integrate EvalRep descriptors and dispatch for Geom/Geom2d (#1089)
Introduce EvalRep descriptors for selected Geom and Geom2d curve/surface
classes and add inline EvalRep utilities for evaluation dispatch with
fallback to native paths.

- add per-class Set/Get/Clear EvalRepresentation API and storage
- support full, derivative-bounded and mapped descriptors
- validate mapped parameter transforms in SetEvalRepresentation()
- migrate Geom_OffsetSurface equivalent-surface path to EvalRep
- clone EvalRep descriptors in copy constructors and Copy() paths
- update adaptors to use EvalRep in supported branches
- keep EvalRep invalidation in geometry mutators and fix regressions
2026-02-15 09:26:56 +00:00
Pasukhin Dmitry
c9bdc4b9f1 Modeling Algorithms - Optimize properties computation for complex compounds (#1091)
Optimized exact vprops path for OCC28402 by reducing TopLoc_Location
composition overhead in edge pcurve lookup.

Changes:
- added fast-path exits in TopLoc_Location::Predivided() for identity and
  equal-location cases;
- cached face surface/location in BRepGProp_Face and reused this context in
  Load(const TopoDS_Edge&);
- in BRep_Tool::CurveOnSurface(...), compute Predivided() only when edge
  has curve representations to iterate.

This keeps algorithmic behavior unchanged and targets the performance
regression reported by tests/bugs/modalg_7/bug28402.
2026-02-15 09:24:57 +00:00