Commit Graph

7136 Commits

Author SHA1 Message Date
Brandon Ross 7d2efad9c8 Mesh - Fix iterator invalidation in Delaun triangle-kill cascade (#1450)
Added snapshot of the neighbours links for delaun algo.
Added checks for removed connections during iterations.
2026-08-10 21:07:52 +01:00
Pasukhin Dmitry 6bf468c87c Data Exchange, IGES - Fix stream rework for corrupted files (#1455)
- Preserve carriage returns embedded within fixed-width 80-column IGES records.
- Support CR, LF, CRLF, and delimiter-free record boundaries.
- Restore legacy handling of physical preambles, encoded FNES records, and shifted D-exponent values.
- Serialize IGES provider tests because the legacy reader uses global state.
- Add exact regression expectations for parsed entities, topology, and corrupted input.
2026-08-10 18:38:29 +01:00
gsdali 07e6d8d40e Modeling Data - Fix AdvApp2Var Jacobi maxima written to the wrong workspace slot (#1418)
Fixed approximation of spherical surfaces]
Regression after https://github.com/Open-Cascade-SAS/OCCT/commit/3016a390713d2e893f4bfa797882b9f0266840e1
2026-08-10 12:20:16 +01:00
Pasukhin Dmitry e177d7e68c Modeling - Fix circular wire handling in BRepOffsetAPI_MakeOffset (#1453)
- Correct KPartCircle() handling when an offset collapses a circular edge.
- Prevent fallback to the generic MAT algorithm after the circular special case has been recognized.
- Add GTests for circular wires at, above, and below the 2 mm diameter boundary.
- Cover negative taper, positive offset, and collapsed-circle cases.
2026-08-10 11:18:46 +01:00
Pasukhin Dmitry 5eba9aff4f Tests - Migrate DRAW tests to Gtests (#1448)
Migrate some DRAW tests which do not use external
  CAD files and which do not use visualisation/image dump.
Some tests were modified, but the original idea was preserved
2026-08-09 22:10:30 +01:00
Pasukhin Dmitry 0f7ab882d5 Foundation Classes, NCollection - optimize iteration workflow (#1446)
Introduce native STL-compatible iterators across NCollection containers.
Streamline container storage and access paths.
Split indexed and double-map base implementations.
Retain legacy iterator interfaces and remove obsolete iterator helper headers.
Improved AliasedArray to handle size_t
2026-08-09 18:52:23 +01:00
Pasukhin Dmitry f713b1305f Modeling Algorithms - Enhance fillet and chamfer handling. Part 2 (#1449)
- Detect complete coincidence between fillet and chamfer intersection curves.
- Preserve orientation relationships between equivalent intersection curves.
- Reuse existing restriction edges instead of constructing duplicate topology.
- Merge coincident curve endpoints into shared topological vertices.
- Exclude fully consumed faces and their obsolete boundary edges during reconstruction.
- Mark edges collapsed to a single vertex as degenerated during construction.
- Accept tangential contacts while rejecting transversal intersections.
- Preserve generated and modified shape history in the resulting topology.
- Add GTests for convex, concave, opposing-edge, chamfer, and history cases.
2026-08-09 15:16:27 +01:00
Angelo Bartolome cbca11e975 Modeling - Enhance fillet and chamfer handling. Part 1 (#1293)
- Retain coincident segments only when no regular hatching domain exists.
- Add synthetic tests for limiting and partial boundary overlaps.
CLA: 1144
2026-08-09 13:45:33 +01:00
Pasukhin Dmitry 0d47342863 Coding, Modeling Data - Clean up dead headers (#1439) 2026-08-08 07:19:35 +01:00
Pasukhin Dmitry 4c2c356490 Data Exchange, IGES - Add stream-based I/O support (#1406)
- Add IGES stream reading and writing to DEIGES providers.
- Extend IFSelect, XSControl, and work libraries with generic stream output.
- Keep STEP work-library output aligned with the shared stream interface.
- Convert the legacy IGES parser from C to modern C++.
- Introduce buffered parsing of fixed 80-column IGES records.
- Support LF, CRLF, CR-only, and delimiter-free record layouts.
- Preserve FNES preamble detection and encoded record handling.
- Handle stream errors, enabled exceptions, partial reads, and cleanup safely.
- Isolate mutable parser data with thread-local storage.
- Serialize access to process-wide IGES configuration and restore it on exit.
- Preserve supplied work sessions, transferred models, and selected modifiers.
- Apply modern OCCT naming, casting, documentation, and control-flow style.
- Add tests for shape and document stream I/O, record layouts, and failures.
2026-08-07 20:28:17 +01:00
Pasukhin Dmitry 1cb09f481b Modeling - Optimize exact face classification fallback (#1400)
- Add a thread-safe lazy grid to CSLib_Class2d for constant-time
  classification away from polygon boundaries while preserving the exact
  tolerance path for boundary cells.
- Normalize coordinates and explicit tolerances robustly, handle invalid and
  extreme input values, and preserve cache state correctly across copy and
  move operations.
- Cache face wires, edge occurrences, pcurves, parameter ranges, and optional
  2D bounding boxes in BRepClass_FaceExplorer to avoid repeated topology and
  geometry traversal during exact classification.
- Introduce explicit cached-geometry and bounding-box states in
  BRepClass_Edge, invalidate derived data on topology changes, and isolate
  bounding-box construction failures per edge.
- Reuse a lazily constructed exact face explorer in
  BRepTopAdaptor_FClass2d, cache periodic surface properties, and serialize
  access to mutable exact-classification traversal state.
- Replace node-based classifier and point sequences with contiguous linear
  vectors, remove intermediate polygon copies, and make tighter wire
  discretization transactional.
- Consolidate Perform() and TestOnRestriction() through a shared
  classification path while preserving their boundary and periodic
  recadrement semantics.
2026-08-07 19:05:46 +01:00
Pasukhin Dmitry caad597813 Coding, Modeling Algo - Clean up dead headers (#1442) 2026-08-07 15:18:39 +01:00
Pasukhin Dmitry e616f301da Coding, Data Exchange - Clean up dead headers (#1438)
VRML is intentionally skipped
2026-08-06 16:41:41 +01:00
Pasukhin Dmitry e521a4a7a7 Coding, OCAF - Clean up dead headers (#1441) 2026-08-06 16:05:42 +01:00
Pasukhin Dmitry 4bcc7dae06 Coding, Foundation - Clean up dead headers (#1437) 2026-08-06 14:36:49 +01:00
Pasukhin Dmitry ea716e3fa4 Coding, Draw - Clean up dead headers (#1440) 2026-08-06 14:00:53 +01:00
Pasukhin Dmitry a2a9a8d96f Configuration - Clean up unsupported scripts and templates (#1428)
Removed adm/scripts which were no longer actual and not validated.
Removed adm/templates which were no longer used and not validated.
Fixed the issue with the mixing FreeType/FreeImage inside env.bat
2026-08-03 15:35:45 +01:00
Pasukhin Dmitry 299344fc95 Coding - Move PR GH template (#1423) 2026-08-02 13:07:25 +01:00
Pasukhin Dmitry 7219e39b2c Coding - Bump version to 8.1.0.dev1 (#1422) 2026-08-02 13:07:11 +01:00
Pasukhin Dmitry b8f597c677 Coding - Bump version to 8.0.1 (#1412) V8_0_1 V8.0.1 2026-07-30 12:43:15 +01:00
Pasukhin Dmitry 06f63f15d5 Coding - Add PR GH template (#1411) 2026-07-30 12:12:20 +01:00
Pasukhin Dmitry 50314b6938 Shape Healing - Skip internal and external edges in ShapeAnalysis_FreeBounds (#1408)
- free bounds should be built from boundary edges only
- ignore edges with INTERNAL and EXTERNAL orientation in ConnectEdgesToWires()
2026-07-30 00:01:25 +01:00
David Kaufman 72f14ee359 Shape Healing - Prevent crash on non-manifold wires in ShapeAnalysis_FreeBounds (#1331)
Shape Healing - Prevent crash on non-manifold wires in ShapeAnalysis_FreeBounds

- Exclude non-manifold-only wires from endpoint-based chaining
- Preserve INTERNAL and EXTERNAL-only wires as standalone results
- Skip empty wires and ensure input-order-independent processing
- Replace the DRAW regression with comprehensive GTests
- Cover mixed, empty, reordered, and non-manifold-only inputs through
  ConnectWiresToWires() and ConnectEdgesToWires()
---------
CLA ID: 1147
Co-authored-by: dpasukhi <dpasukhi@opencascade.com>
2026-07-29 21:16:09 +01:00
Pasukhin Dmitry cffb2852ba Modeling - Prevent crashes in ChFi3d_Builder::StartSol (#1407)
Guard invalid edges, faces, adaptors, and missing pcurves before they
  are passed to BRepAdaptor_Curve2d or dereferenced during chamfer construction.
When the topology does not provide a valid curve-on-surface, preserve
  the existing state where possible and return false.
This makes an oversized or otherwise invalid chamfer finish with IsDone() == false
  instead of crashing in BRep_Tool::CurveOnSurface.
2026-07-29 19:14:52 +01:00
Andy Aragon d8b85a6626 Modeling - Optimize elementary deviations in GeomLib_CheckCurveOnSurface (#1373)
Use Adaptor3d_CurveOnSurface composed-curve recognition to handle
  provable elementary cases directly:
- compute the exact maximum at interval endpoints for line pairs;
- Compute exact maxima for line pairs and use trigonometric roots for
   circle and ellipse pairs.
- preserve the existing PSO/Newton pipeline for all other cases.
---------
CLA ID 1148
Co-authored-by: dpasukhi <dpasukhi@opencascade.com>
2026-07-29 19:01:17 +01:00
Pasukhin Dmitry fcf1ea22e9 Documentation, Configuration - Correct guides and generation setup (#1404)
Correct obsolete API references, code examples, terminology, links, and
contribution workflow instructions across the documentation.

Generate Doxygen example paths from OCCT package metadata and fix license
markup. Remove obsolete documentation CMake, layout, and unused PDF
generation files.
2026-07-29 00:36:13 +01:00
Pasukhin Dmitry 13526d7a1b Configuration - support MSYS2 FreeType and TBB discovery (#1403)
Enable system TBB discovery on Windows when no explicit third-party
installation is selected. Support MinGW FreeType import libraries and
versioned runtime DLLs.

Preserve imported CMake targets during CSF processing and validate
MSYS2 GCC and Clang dependency artifacts in master validation.
2026-07-28 20:31:20 +01:00
gsdali 0e675a7413 Shape Healing - Handle empty wire sequences in ShapeAnalysis_FreeBounds (#1377)
Initialize the output sequence when ConnectWiresToWires receives null or
empty input. This prevents SplitWires from appending a null sequence when
all free-boundary edges have been consumed as closed loops.

CLA ID: 1139
2026-07-28 17:03:28 +01:00
gsdali 9825547d15 Modeling - Make fillet solid reconstruction reentrant across threads (#1374)
BRepFilletAPI_MakeFillet reconstructs its result solid through the legacy
TopOpeBRepBuild engine (ChFi3d_Builder::Compute -> TopOpeBRepBuild_HBuilder::
MergeSolid -> TopOpeBRepBuild_Builder::SplitSolid), which passes state between
methods through file-scope static variables. That makes it non-reentrant: two
BRepFilletAPI_MakeFillet builds on independent shapes on separate threads corrupt
each other and yield a wrong-but-plausible solid that fails BRepCheck.

ThreadSanitizer on an 8-thread fuse+fillet stress pinpoints the functional cause as
STATIC_SOLIDINDEX (TopOpeBRepBuild_Builder.cxx): SplitSolid sets it to 1/2 to tell
FillSolid which operand it is splitting, FillSolid reads it back. Concurrent
reconstructions interleave the writes, so FillSolid mis-classifies faces and drops
material. Converting that one variable to thread_local makes a 1600-build concurrent
stress return correct geometry every time (was ~15-20% corrupt).

Converts the fillet-path shared statics to thread_local (each thread keeps its own
copy of the cross-call state; single-thread behaviour is unchanged):

- Functional: TopOpeBRepBuild_Builder STATIC_SOLIDINDEX; TopOpeBRep_kpart
  STATIC_lastVPind (same cross-call-cache pattern).
- Benign data races on the same path (no corruption, but flagged by TSan):
  BlendFunc_ConstRad / BlendFunc_EvolRad ComputeValues scratch; ChFi3d_Builder_6
  checkcurve.

Same class of fix, same engine, as the earlier TKBool thread_local conversion
(#1180); these were not covered by it. Reported downstream as SecondMouseAU/
OCCTSwift#298.
2026-07-28 15:03:41 +01:00
Pasukhin Dmitry 6a7e068773 Modeling Data - Prevent exception in BRep_Tool::CurveOnPlane (#1402)
Validate the edge range against the effective curve basis before
constructing Geom_TrimmedCurve. Preserve valid periodic ranges and
return a null pcurve for inconsistent bounded ranges.
2026-07-28 12:38:53 +01:00
Pasukhin Dmitry 97c092347d Data Exchange - avoid infinite loop in STEP writer (#1318)
Split oversized raw STEP strings in StepData_StepWriter::AddString() instead of repeatedly flushing the current line when the text cannot fit into the 72-character buffer.

Drop indentation for continuation lines when the indented prefix would leave no room for the pending text.
2026-07-28 10:42:20 +01:00
gsdali be8a1f1e3d Shape Healing - Catch replaced faces in ShapeFix_Face (#1323)
ShapeFix_Face::Perform() now skips processing if the context has already
removed the face or replaced it with a non-face shape.

CLA ID: 1139
2026-07-28 10:30:00 +01:00
Brandon Ross dee5485463 Modeling - Optimize BRepCheck_Face classification for faces with many holes (#1375)
Precompute conservative UV bounds for closed wires and skip expensive
containment checks for disjoint wire pairs. Fall back to the existing
classification when reliable finite bounds cannot be constructed.
2026-07-28 09:20:48 +01:00
gsdali 250305cb5b Shape Healing - Guard null context in periodic face healing (#1380)
ShapeFix_Face::FixPeriodicDegenerated() unconditionally recorded the
result through Context()->Replace(), although ShapeFix_Face can be used
without assigning a reshape context. This caused a null dereference when
healing a periodic conical face bounded by a single closed edge.

Guard the replacement when no context is available while preserving the
healed face in myResult.
2026-07-27 22:29:11 +01:00
cmoliverio 6a4fd51cf6 Documentation - Improve bottle tutorial point diagram (#1325)
Replace the outdated bottle profile diagram with a clean, scalable SVG.
Label points P1 through P5 and the coordinate axes, and correct the point
coordinates to match the tutorial implementation. Improve spacing and
alignment so that coordinate labels remain readable without overlapping.
2026-07-27 22:19:20 +01:00
gsdali f91de41ecc Modeling Algorithms, UnifySameDomain - Guard null pcurve dereferences (#1392)
Prevent null pcurve dereferences during pcurve relocation, transformation,
wire construction, and edge selection. Skip only the affected face group
instead of aborting processing of the entire shell.
2026-07-27 21:02:32 +01:00
gsdali ff24d69967 Modeling Algorithms - use the adaptor's NbPoles() in BRepGProp_EdgeTool::IntegrationOrder (#1382)
Use BRepAdaptor_Curve::NbPoles() when selecting the integration order
for Bezier and BSpline curves. This keeps the pole count consistent with
the curve representation reported by GetType() and avoids dereferencing
a null 3D curve for edges represented only by a curve on surface.
2026-07-27 19:32:39 +01:00
dpasukhi 37dd5686f2 Coding - Bump version to 8.0.1.dev 2026-07-13 13:46:57 +01:00
Pasukhin Dmitry aa3e65da8d Mesh - Fix periodic seam constraints (#1338)
The base mesh algorithm created constraint links for all pcurves of an
  edge, including duplicate representations at periodic seams.
Register nodes and mesh indices for all pcurves so polygon-on-triangulation
  data remains valid, but add links only for the pcurve of the wire occurrence.
2026-07-13 13:42:10 +01:00
Pasukhin Dmitry d3042539c7 Modeling - Improve Gordon surface construction for rational networks (#1335)
- Reparametrize rational B-spline curves exactly when possible and preserve
  homogeneous reference-surface weights.
- Improve closed-network contact selection and curve-to-surface deviation
  validation.
- Use grid evaluators for approximate fallback construction.
- Add regression tests for rational, periodic, and dense curve networks.
2026-07-11 09:03:24 +01:00
Pasukhin Dmitry e2de4398ca Data Exchange - initialize STEP writer healing parameters (#1334)
Call initialisation of missed shape heading parameters during transferring
2026-07-10 19:44:33 +01:00
Dmitrii Kulikov 37c9279f44 Modeling - Boolean section stuck in infinite loop (#1329)
Method Geom_BSplineCurve::PeriodicNormalization() is rewritten - it now
has algorithmic complexity O(1) instead of O(N) and protected against
rounding error for large numbers.
2026-07-05 14:51:36 +01:00
dpasukhi 4f95ecaa3b Tests - Update master build VS version V8_0_0_p1 2026-06-16 15:45:17 +01:00
Pasukhin Dmitry 13d19b9a1f Tests, BRepGraph - Add GTests for reversed face shell orientation (#1314)
- Add helper to create shell with all faces reversed
- Test FaceRef stores REVERSED orientation for all faces
- Test ParentExplorer reports shell as parent for reversed faces
- Test Reconstruct produces valid face definitions
- Test shell reconstruction preserves REVERSED face orientations
- Unify test fixture names to BRepGraph_ReverseTest
2026-06-16 09:03:48 +01:00
Christoph Moench-Tegeder 8a3f204601 Data Exchange - on FreeBSD, check for standard-conforming timezone variable (#1277)
On FreeBSD, "timezone" from time.h only recently started following the
POSIX/XSI standard. Before that switch, timezone used to be the
historical BSD function "char *timezone(int, int)", which is
obviously not what the code here expects.

For older FreeBSDs, provide a workaround using time() and localtime().

The closest __FreeBSD_version increment I could find is 1500019,
compare
https://cgit.freebsd.org/src/commit/include/time.h?id=a34940a9756ac8edce36fec176949ee82e9235b4
and
https://docs.freebsd.org/en/books/porters-handbook/versions/#versions-15

See https://pubs.opengroup.org/onlinepubs/9799919799/ for official
POSIX documentation, especially
- https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html
  for time.h
- https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap02.html#tag_02_01_04
  for X/Open System Interfaces (XSI)
and also FreeBSD man pages (especially the difference between versions)
- https://man.freebsd.org/cgi/man.cgi?query=tzset&apropos=0&sektion=0&manpath=FreeBSD+14.4-STABLE&format=html
- https://man.freebsd.org/cgi/man.cgi?query=tzset&apropos=0&sektion=0&manpath=FreeBSD+15.0-STABLE&format=html

CLA: 1143
2026-06-15 19:51:37 +01:00
Pasukhin Dmitry 2cf9450d6d Visualization - Add back-face vertex color policy (#1313)
- Add aspect API controlling vertex color use on back faces
- Generate front-only vertex color shader variants for face programs
- Expose the option through ViewerTest and add DRAW/GTest coverage
2026-06-15 19:49:13 +01:00
Dmitrii Kulikov 9f4899148c Modeling - Handle near-zero angles for coplanar faces in GetFaceOff function (#1312) 2026-06-15 18:35:03 +01:00
Pasukhin Dmitry 03856df0b9 Modeling Data - Fix BRepGraph topology placement population (#1311)
- Kept TopoDS definition data local while storing root
  and compound placements on graph references.
- Preserved located triangulation and polygon-on-triangulation
  data during population.
- Preserved degenerate natural boundary edges and cleared
  full-graph state consistently in Perform().
- Kept original TopoDS shape lookup bindings valid
  across population and compaction.
- Rebuilt compacted compounds in two passes so nested
  compound references keep their local placement.
- Added focused regression coverage for located meshes,
  nested compounds, shape lookup, compaction, degenerate boundaries, and reset behavior.
2026-06-15 15:46:00 +01:00
Dmitrii Kulikov 2c7d5fbdbd Modelling - Fix infinite loop in IntWalk_IWalking::ComputeOpenLine() (#1263)
Infinite loop occurred in IntWalk_IWalking::ComputeOpenLine() inside 'while (!Arrive)' loop.
Fixed by checking for degenerate case after very large amount of iterations have passed.
2026-06-15 14:46:57 +01:00
Pasukhin Dmitry ea3fc1f8bd Modeling, BRepGraph - Identity copy path, lock-free cache reads, per-CoEdge queries (#1306)
Identity copy path:
- copyFullGraphIdentity with PrepareForLoad() + direct slot assignment
- CopyDerivedRelationsFrom for O(K) relation vector copy
- CopyRemovedFlagsFrom for bulk removed-flag copy
- CopyShapeBindingsFrom for TShape/Original shape binding copy
- PrepareForLoad skips Clear() when storage already empty (IsEmpty fast path)
- appendRelationIdDirect for O(1) append in rebuild loop (duplicates structurally impossible)
- ChangeCompoundRefsOfNodeInternal uses TryBound for single lookup
- Counts() and ActiveCounts() accessors for Counts struct construction

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

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

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

Other optimizations:
- Iterator Next() fast-path: check next element validity inline
- NbFaces O(K) inline dedup with NCollection_LocalArray
- GeomAdaptor_Curve/Surface/Geom2dAdaptor_Curve for cached geometry eval
- Value() calls replaced with EvalD0() for clearer naming
- TargetItem returns value instead of pointer (no null-pointer risk)
- copyTopologyDefinitionsIdentity clears Curve3DRepId on GeomPolicy::Drop
- ensureEdgeEntry concurrency: fast-path validation + selective field merge
2026-06-14 14:15:32 +01:00