Problem: From the point of view of the STEP format (and others), it is allowed
to describe a face on a surface with natural boundaries (torus, sphere) without
specifying these boundaries. Thus, a face on a closed surface and containing
an inner wire (or several) is correctly defined and describes a face with a
cutout defined by this wire. At the same time, there is a function
(ShapeFix_Face::FixOrientation) in the ShapeHealing procedure that corrects the
orientation of the wires, and it starts before the function of adding natural
boundaries (ShapeFix_Face::FixAddNaturalBound). There are many shapes that have
incorrectly oriented wires and this procedure successfully heals them, but on a
correctly specified face with single inner wire on closed surface, we do not get
the entire surface with a cutout, but a part of the surface defined by the wire.
This fix is intended to resolve this ambiguity.
Change:
1. Added function isNeedAddNaturalBound that returns TRUE if face needs to add
natural bounds.
2. Corrected condition in FixOrientation to ignoring faces that needs to add
natural bounds.
3. For tests in which one wire was incorrectly oriented on a closed surface,
flag AddNaturalBound was disabled.
5. Test with cutout from torus was created: bugs step bug28414.
Result: By default, it is correct to add natural boundaries, because this case
is correct from the point of view of the STEP format and others.
Possibility for adding LengthUnit info to XCAF document using special class XCAFDoc_LenghtUnit and XCAFDoc_LenghtUnitTool is implemented.
Package UnitsMethods is split: geom methods were placed to new file GeomConvert_Units which is in the toolkit TKXSBase, internal step scale factors was placed to StepData.
Updated UnitMethods to convert scale factor to different unit types.
Now, XSAlgo::XSAlgo_AlgoContainer is used to update unit info from static interface values.
New Draw command "XSetLengthUnit" and "XGetLengthUnit" for set or get XDE attribute.
Upgraded tests for STEP, IGES, OBJ, glTF, VRML formats to check area regressing with used unit.
Upgraded tests\de test cases to use any units in the "loop back" algorithms.
- Upgraded files using new version of WinFlexBison
- Removed global variables within StepFile_Read.cxx
- Upgraded error message during bison analyzing ( added a expected expression information )
- Used 'Interface_ParamType' as argument type for the StepFile_ReadData::Argument
for a compatibility with the StepData/StepData_StepReaderData
- Added handling parse errors and transferring it to the StepData_StepReaderData
- Now parsing and referencing errors save in the check and non output by default
- Step_file's and Step_Data's output info prints according by trace level of printer
- Removed useless location.hxx
- Removed TraceLevel for the StepFile_Reader ( now it useless,
it is 0 by default and newer and nowhere change )
- Translate error message into English within StepData_StepReaderData
- Replace "Error" word in the output messages
- Added checking for null objects
- Added support to find layers according to visible attr
- Fixed problem with same names of layers:
Now, layers are grouped by names and visibility parameter
In the result of translation one face lying on the spherical surface converted to the two separate faces due to method IsSurfaceUVPeriodic returned false for spherical surface.
Now method IsSurfaceUVPeriodic returns true for spherical surface in order to natural bounds can be added for spherical surface too.
Method ShapeFix_Face::FixOrientation was corrected to avoid reversing inner wire for case when spherical face has only one inner bound without outer bound.
Check that wire has bounding box equal to bounding box of surface was added in the method ShapeFix_Face::FixAddNaturalBound in order to avoid addition of the natural bounds ( test bugs xde bug22535_2 1 for face 2 lying on the torus)
In order to avoid regressions fix for translation "VERTEX_LOOP" entities was added. Natural bounds for "VERTEX_LOOP" lying on the Spherical and BSpline surface is added only if face does not have any other bounds.
In other case natural bounds were added during ShapeFix operation after translation in order take into account mutual position of the all bounds in the UV space of the face.
Changes made for #31233 are reverted.
Correction in the ShapeFix_ComposeShell:
Modification of the method SplitByLine in order to find all points of the intersection for case when initial curve shifts in the positive or negative direction
to avoid splitting edge when split point lies in the limits of the tolerance of the vertex.
to correct shift of the pcurves for case when initial shift is more than 1 in the method ShapeFix_ComposeShell::SplitByLine
In the method ShapeFix_Face::FixMissingSeam added removing small edges having length less than working precision and removing wires having area less than working precision
Modified test cases; added test for related issue: bugs step bug31301
Approx/Approx_SameParameter.cxx,hxx:
Class Approx_SameParameter refactoring. Logic is changed in many places to unify usage, simplify maintenance.
Method Curve2d() is changed to return Geom2d_Curve instead of Geom2d_BSplineCurve. Corresponding message is added to the upgrade guide.
.lxx file is merged into .hxx.
Tangent computation is extracted into special method.
Comparing number of sample points after CheckSameParameter(...) is added to define cases with projection fails.
Undesirable behavior when curves are not same parameterized is fixed.
Geom2dAdaptor/Geom2dAdaptor.cxx: treatment of offset curve is added
Adaptor3d/Adaptor3d_TopolTool.cxx: minor improvement of performance for BSpline surfaces with huge number of knots
Tests were modified according to new behavior of sameparameter algorithm
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
Duplicating colors has been merged within enumeration:
CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
Added aliases to several other common colors:
BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
Removed unused class Quantity_ColorDefinitionError.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.
Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
Special treatment of bspline curve of first degree is implemented in Extrema_GExtPC.gxx
Test case is added
Some test cases are modified according to actual state of algorithm
Now roots-references in XCAF Document can be exported to STEP without losing structure of assembly/sharing/metadata of this root. New auxiliary root assembly with each root-reference is created to save all necessary data.
Output information about failure during reading of external file has been added (it can be checked by using Draw command "tpstat").
If the reader cannot find an external file at the first found location
(using entity APPLIED_EXTERNAL_IDENTIFICATION_ASSIGNMENT) it checks other information about file path
(using entity DOCUMENT_FILE related with the above-mentioned entity) and uses a new location for import of the external file.
The "end" file from folder "de" has been corrected to exclude comparing the number of edges in the shapes from current result with test data.
"TODO messages generated for differences were removed.
Data exchange tests were regenerated.
Test parse rules are improved to recognize messages with word 'fail' or 'failure' as errors.
Test cases are corrected accordingly (TODO or REQUIRED statements added where fail messages were not noticed previously).
The usage of *BRepAlgo_Section* has been replaced with the usage of *BRepAlgoAPI_Section* in *BRepProj_Projection* algorithm.
The TODO statements have been removed from the failing test case in the "prj" grid as they are working correctly now.
The following changes have been made to improve the performance *BRepAlgoAPI_Section*:
1. Revision of the *IntPolyh_Intersection* class to avoid repeated calculation of the deflection of the same triangulation.
2. Small revision of the Edge/Face intersection algorithm to perform Extrema computation on the whole intersection range of the edge instead of discrete ranges.
3. Implementation of the extrema computation for the Circle and Sphere.
4. Correct computation of the parameter of the point on the Circle.
Function Strtod() is reimplemented using open source (MIT-style license) code by David M. Gay instead of strtod() provided by standard run-time library. This improves its performance by 3-10 times.
Functions Atof(), Strtod(), Printf(), Sprintf(), Fprintf() are declared as extern "C" to be usable from C programs.
Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.
DRAW command QATestAtof and test perf fclasses strtod are added to check correctness and performance of Strtod().
Test perf draw restore is added to monitor performance of reading BREP files.
Minor off-topic corrections:
- method Standard_GUID::Assign (const Standard_UUID&) is implemented (was empty);
- Precision.hxx is included in BRepMesh_Vertex.hxx that uses it.
Upgrade check of closeness of 2dcurve to line during projection:
For C1 and more surfaces check distance to normal, not to surface, for C0 surfaces update tolerance formula.
Add check for possible period jump in some inner point.
Update some test cases.
Add cache saving for lines,
update fixPeriodicTroubles() function, using parameters from cashe.
Small correction of test cases for issue #26930
fix processing of points from cache.
Update of test cases according to the new behavior
Fix behavior of fixPeriodicityTroubles() on different isolines,
fix copy/paste mistake.
Update test cases:
iges_2 C4 - return to master values
step_3 E6 - improvement.
Modification to create natural bounds for face based on the spherical and Bspline surface and having only one bound represented by Vertex loop was made.
According to the specification of ISO-10303 part 42:
"If the face has only one bound and this is of type vertex_loop, then the interior of the face is the domain of the face_surface.face_geometry. In such a case the underlying surface shall be closed (e.g. a spherical_surface.)"
- natural bounds are applied only in case if VertexLoop is only the one
defined face bound.
Update of test-cases according to the new behavior
Test-case for issue #24595
Modification to support case when edges on face have incorrect orientation was added.
Modification to support case when wires have intersecting segment was added
Test cases for issue 25553 added; other affected tests corrected (improvements)
Corrected test case
1. B-spline cache was moved into separated classes: BSplCLib_Cache for 2D and 3D curves and BSplSLib_Cache for surfaces.
2. The cache is used now in corresponding adaptor classes (Geom2dAdaptor_Curve, GeomAdaptor_Curve and GeomAdaptor_Surface) when the curve or surface is a B-spline.
3. Algorithms were changed to use adaptors for B-spline calculations instead of curves or surfaces.
4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx)
5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation.
6. Test cases were modified according to the modern behavior.
7. Changes in BOPAlgo_WireSplitter, BOPTools_AlgoTools, BRepLib_CheckCurveOnSurface and ShapeAnalysis_Wire to use adaptors instead of geometric entities
8. Allow Geom2dAdaptor and GeomAdaptor in case of offset curve to use corresponding adaptor for basis curve
Modification of test-cases according to the new behavior.
Unstable test cases were reviewed
Modified test cases using checktrend command
Modified test cases for Linux platform
Modified test cases for Debug mode
Recalculate of tolerance before edge cutting
Test case for issue CR25013
add try to increase tolerance before splitting in singularity during PCurve adding.
Correction of test cases for issue CR25013
1. bugs modalg_4 bug697_2 bug697_4 bug697_7 bug697_8 - unstable test cases after fix 25735
Its will be checked and modified during work with performance (issue 24232).
2. bugs mesh bug25364 was tuned for 64-bit Windows.
3. de step_1 ZQ2 fails (64-bit only). Issue 25848 was registered.
4. de step_3 D8 shows improvement (no checkape error) in 64-bit only, this is after 22598 and issue 25797 was registered for that.
5. draft angle G8 improvement (algorithm produces some shape, but fails on checkshape).
6. perf ncollection A1 was tuned for 64-bit Windows.
7. de step_1 R9 - update reference data (according to 25176)
1) Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to
catch Standard_ConstructionError during the Curve conversion.
2) Checks of BSpline curve degree added to prevent construction error when converting edges to BSpline_Curve.
3) Warning message was added in case of incorrect curve definition.
Correct of the test cases according to the new error message added with fix
Conflicts:
tests/de/step_1/R9
Modified test cases according to new reference data
Interface_CheckTool does not reset the Check added to CheckList now.
Added test case bugs/xde/bug25176
Update reference data in test cases.
Resolving conflicts:
tests/de/iges_3/A4
tests/de/step_1/R7
tests/de/step_2/H1
Check whether p-curve being projected can be approximated by straight line is made before full-scale projection, to improve performance.
If straight, pcurve is created as Line only if this will lead to the same range parameterization as 3d curve, otherwise BSpline of degree 1 is created.
Re-approximation of line pcurves by bsplines removed from ShapeFix_Edge.
Test case updating to new behavior.
Added "static" keyword to the fixPeriodictyTroubles() function.
Update of test-cases according new behavior
1. DRAW-commands for curve/surface continuity returning were changed.
2. Output of "distmini" DRAW-command is amended.
3. Function MinMax() was moved from Standard_Real to IntPatch_ImpImpIntersection_4.gxx.
4. Incorrect computing of nbcurveC1 in Geom2dConvert::C0BSplineToC1BSplineCurve(...) function was liquidated.
Test cases were changed.
Method STEPConstruct_Styles::LoadStyles() now imports StepVisual_StyledItem entities even if they was defined without StepVisual_MechanicalDesignGeometricPresentationRepresentation or StepVisual_DraughtingModel entity
Update of reference data
MAIN CHANGES:
FixAddNaturalBound: the boundaries of "natural bound addition" are restricted: a face, that does not contains an outer wire, should not have any infinite UV boundaries due to new face building (with using a surface) requires specified UV boundaries.
FixAddNaturalBound: myResult is updated in FixAddNaturalBound when the method creates a new face with natural boundary. myResult is required to be updated for next "fix small-area wires" algorithm
IsPeriodicConicalLoop: incorrect working BRepTools_WireExplorer was replaced on TopoDS_Iterator.
a natural bound is added to all the faces are constructed with UV-periodical surfaces (not only sphere and torus; e.g., closed b-splines)
other:
ShapeAnalysis: ReverceSeq renamed to ReverseSeq
BRep_Tool Pnt and Tolerance has the check for null TShape
Test cases for issue CR24249
required null checks were added
test cases were corrected according to their new behavior
Correction test case for issue CR24249
In cutting sphere it's seam edge was divided into two parts(by cylinder),
but pcurves of the second were not shifted during shape healing.
Test cases correction
Fix that face, in which only wire was reordered during shape healing, was not replaced.
Add test case for this fix
Add status for shifted wires in reordering.
Modified test case de/step_1/E3 according to new reference data
Add check for too small distances during edges reordering
Fix writing TrimmedSurface (Type 144).
Fix checking for too small distances between loops of edges during edge's reordering.
Add checking for too small BSpline segments during reading and writing IGES.
Fix wire splitting by adding checking that vertexes same not only in 3d, but in 2d too.
use tolerance of vertexes recomputed through resolution surface, not 2d curves.
Adding test case for this fix
Modified test case bugs iges bug23746 and cases in group de according to new reference data
Added treatment of the vertex as a single object.
Added test case bugs/modalg_5/bug24060
Modified shape's extension in test cases bugs/moddata_3/bug23943_3 bug23943_4
Modified test cases in group de according to new reference data in issue 24035
asymmetrical check in Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect was changed to symmetrical.
fix wrong calculation of approx parameter on curve for last polygon segment
Added test case bugs/modalg_5/bug24035
Modified TODO in "de" test cases because there are small differences with old behaviour
Modified test case heal/split_closed_faces/G5 because of corrections in intersector's behavior, which lead to changes in checkshape
Loop back tests for iges and step files with possibility of generation of reference data.
Clean up of test scripts (removal of obsolete code, adding comments, corrected formatting)
two fixes were done (same like bug 23722 and bug 23736)
Cancelling checking for number of warnings
rewrite some test scripts in cause of this and fix 23794
Tolerance checking was weakened.
Fix to check instability on Linux (bug 23822) was added.
TODO messages was added to tests which have different results on Windows and Mandriva2010
Ability to update this TODO in regeneration mode was added.
Add fix to bug 23852
Test groups were recomposed.
'dataexch' was renamed to 'de'.
CPU limit was decreased from 2000 sec. to 1500 sec.