1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

Compare commits

..

58 Commits

Author SHA1 Message Date
dpasukhi
2674598ff1 0033353: Data Exchange, Step Import - Healing corrupted file with missed vertex edges
Added detection vertex from STEP edge neighbors or own curve
(Commit just to test)
2023-04-03 02:25:10 +01:00
dpasukhi
c51df6bfd2 0033327: Data Exchange, IGES Import - SubfigureDef can't read string
Fixed problem with texted types
Added checking for null string for subfigure via XCAF transferring
2023-03-20 23:11:36 +00:00
dpasukhi
5e43274280 0033337: DRAW - Can't load plugins on Linux OS
WSL 2 have windows FileSystem and as a result we have \r symbols before \n
For this cases we can just remove \r\n (\n is a last symbol) for the node value.
2023-03-20 23:11:35 +00:00
dpasukhi
efe960751c 0033331: Data Exchange, Step Import - Unsupported Representation Items
Fixed problem with iteration on Null RI
2023-03-20 23:11:27 +00:00
anv
6b9e0dc3f8 0033345: Coding - Memory allocation operators got inaccessible
Macros was moved back to public.
2023-03-19 20:53:54 +00:00
akaftasev
2ef94c994e 0033340: Modeling Algorithm - Improve memory management performance in the PaveFiller
Changed NCollection_BaseAllocator to NCollection_IncAllocator in BOPAlgo_PaveFiller::MakeBlocks()
2023-03-19 20:53:53 +00:00
dpasukhi
1dd4b902c0 0033092: Data Exchange, Documentation - Implementation of DE_Wrapper documentation
Implement new user-guide documentation for DE Wrapper
2023-03-19 20:53:53 +00:00
akaftasev
a846d36326 0033264: Modeling Algorithms - Result of section operation is incomplete
Test case added.
2023-03-19 20:53:53 +00:00
akaftasev
86e352849d 0033263: Modeling Algorithms - BRepFilletAPI_MakeFillet doesn't work for current parameters
Do not calculate edge state if there are more than 4 G1 connections for currect vertex.
2023-02-10 15:35:41 +00:00
akaftasev
6d140acb14 0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false
BRepBndLib.cxx : treatment of useTriangulation is modified according to specified behavior of algorithm
BRepTest_CurveCommands.cxx : creation edge from polygon3d is added in Draw command mkedge.
2023-02-06 17:51:52 +00:00
akaftasev
44be123039 0030055: BRepOffset_MakeOffset throws "TopoDS_Vertex hasn't gp_Pnt" in intersection mode
Diagnostic of mixed connectivity of faces along common edge is added.
If algorithm finds such pair of faces, it stops working with special error code.
2023-02-06 14:15:35 +03:00
dpasukhi
47263fa6a3 0033317: Data Exchange, Step Export - Ignoring color attached to the reference shape label
Fixed problem with pure referencing.
  To export reference label to step we convert it to the assembly with one part.
  All attributes attached to the label should be moved to the new part.
  For working with it new map contains only pure reference labels, that converted to the part
  was implemented to the STEPCAFControl_Writer.
Updated code style of the STEPCAFControl_Writer
Improved ability to export labels from different documents
Removed OCCT_Debug macros to print in Trace gravity
2023-02-04 09:18:29 +00:00
mzernova
b0afa94d10 0027848: Visualization - sensitivity of lines is too high
Improved objects sorting by depth.

The sensitivity calculation for the manipulator has been changed.
Now the sensitivity of the elements of the manipulator depends on its size.

Also fixed the problem of erroneous selection of unfilled circles (SelectMgr_Frustum<N>::hasCircleOverlap() function).

Test case vselect/bugs/bug27848 added.
2023-02-04 09:17:58 +00:00
dorlov
c772c6caa4 0030828: Data Exchange - The commands getting shapes from XCAF document should be available in C++
Added two new overloaded methods XCAFDoc_ShapeTool::GetOneShape: one returns TopoDS_Shape from TDF_LabelSequence and the other from a sequence of all top-level shapes which are free
2023-02-02 15:04:50 +00:00
mzernova
53eae1a935 0032570: Visualization, AIS_AnimationObject - define rotation around axis
When using AIS_AnimationObject, linear interpolation is performed from one gp_Trsf transformation to another.
But when an object rotates around a specific axis, the object moves not along a linear trajectory,
but along a circle. Therefore, a separate class AIS_AnimationAxisRotation was created that
allows to animate rotation around a specific axis.

Test case tests/v3d/bugs/bug32570 was added.
2023-02-01 23:26:46 +00:00
dpasukhi
d22b135217 0033307: Data Exchange, Step Import - Crash after reading empty edge loop
Fixed problem with empty edge list in the edge loop, mark as a fail entity in this case
2023-02-01 00:09:26 +00:00
vro
3c7c705d77 0033320: Data Exchange - Reading of a VRML file with a long line fails
Implement rolling back input stream to split on possible logical parts by comma or space.
2023-01-24 22:38:57 +00:00
dorlov
fc72568ba9 0033312: Data Exchange - NULL-dereference in StepToTopoDS_TranslateShell::Init()
The condition "if" was changed to opposite
2023-01-20 03:10:45 +00:00
akaftasev
107b57a955 0033311: Modeling Algorithm - No results of thrusection algorithm
Changed default value of myPercent
2023-01-17 20:47:54 +00:00
oan
8b301eb865 0033315: Mesh - BRepMesh_IncrementalMesh takes forever to finish (ends up with system memory, etc)
Added test case
2023-01-16 22:00:35 +00:00
rodrlyra
1f469e3781 0033305: Coding - BOPTools_PairSelector::Clear method uses "Clear" instead of "clear" on std::vector 2023-01-16 15:22:08 +00:00
akaftasev
ce4d294074 0033306: Modeling Algorithm - Crash in TrimEdge() method
Added condition to not cut the edges by closely located parameters
2023-01-09 21:44:11 +00:00
akaftasev
9f338a00a1 0033298: Modeling Algorithm - Offset operation gives wrong result
Process only those images of the faces, if one if them has anInsideEdges/anInsideVertices and the other is not.
2023-01-03 18:01:14 +00:00
akaftasev
a011359b8a 0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result
Deleted outer loop for shells.
Added additional check of edges orientation for RefineShell().
2023-01-03 18:01:05 +00:00
msv
42e4ae96ae 0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form
Protect the static function ConicDefinition from calling sqrt with negative argument.
2023-01-03 18:00:55 +00:00
akaftasev
686926c0a9 0033247: Modeling Algorithm - BOP report small edges problem and produce empty result
Build shifted pcurve for ellipse and circle cases.
2022-12-22 16:20:54 +00:00
akaftasev
a638dd6224 0033265: Modeling Algorithms - Boolean operation hangs on the attached shapes
Added test case.
2022-12-16 14:28:08 +00:00
ifv
961a306dc4 0033244: Modeling Algorithms - Surface-surface intersection produces the double curves
IntAna_QuadQuadGeo.cxx - estimation of angular tolerance is added for case cone-cone

tests/lowalgos/intss/bug33244 - new test case added
2022-12-12 10:27:10 +03:00
ifv
195a068c4f 0030781: Sweep algorithm creates non-planar edges (orig. BOPAlgo_MakerVolume fails to build a solid)
BRepFill/BRepFill_AdvancedEvolved.cxx - estimation of angular tolerance is added in method GetLids()

tests/evolved/voluved/bug30781 - new test added
2022-12-10 14:04:53 +00:00
dpasukhi
669e0dfc17 0033246: Data Exchange, DE Wrapper - Checking license leads to performance problem
ReWork UpdateLoad functionality:
UpdateLoad calls only if provider is found.
UpdateLoad calls only for chosen type of translation (read/write)
Add new method to UpdateLoad all registered nodes.
2022-12-10 14:02:56 +00:00
nunomsil
74cb5673a5 0031919: Modeling Algorithms - General Fuse raises exception on attempt to imprint a contour to a shell
Exception no longer occurs in current version. However, fuzzyvalue should be set to 1 for the result of the operation to make sense (result of common is 1 wire). Test case added
2022-12-07 14:45:36 +00:00
dpasukhi
768f3a4a19 0033235: Configuration - Solving the problem with static building of ExpToCasExe
Added new dependency to ExpToCasExe - CSF_wsock32 (on Win only)
2022-12-04 13:49:06 +03:00
dpasukhi
2a8c5ad46c 0033250: Configuration - Missing Limits header file
Added new include limits to fix build problem
2022-12-04 13:48:24 +03:00
stv
7ea3eff4f8 0033218: Data Exchange - XCAFPrs_Texture not allow to use classes inherited from Image_Texture
Type of field XCAFPrs_Texture::myImageSource was changed from Image_Texture to Handle(Image_Texture)
2022-12-04 13:47:36 +03:00
dpasukhi
c07f4ee70d 0033232: Data Exchange, DE_Wrapper - Implement ability to change global session
Add ability to set/get global session
2022-12-04 13:46:38 +03:00
dpasukhi
6cc679d81c 0033230: Data Exchange, DE Wrapper - Update API to find CAD provider
Moved FindProvider method to public section
Made FindProvider as virtual to make it possible to overwrite.
2022-12-04 13:46:38 +03:00
dpasukhi
62f554bc3f 0033228: Data Exchange, DE Wrapper - Make the document argument of the method Read const handle
Rewrite document argument for DE_Wrapper Read method
2022-12-04 13:46:37 +03:00
sshutina
7eeb5d5fbf 0032965: PMIVis - PMIVis_TOT_Vectorized text regressions
Added the ability to draw a shaded shape in the required group.
2022-12-04 13:44:52 +03:00
oan
9b7f1aea28 0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()
Define minimum number of points for specific types of curves like it was done for circular edges.
2022-12-04 13:43:52 +03:00
knosulko
1e96cf65fa 0033156: Modeling Algorithms - Planar face creation problem
BRepLib_MakeFace::BRepLib_MakeFace: deleted degenerative edges from the input wire;
add test tests\mkface\mkplane\bug33156.
2022-12-04 13:42:28 +03:00
ddzama
03275c0be1 0022821: Crash with BRepFilletAPI_MakeFillet
test bugs modalg_7 bug22821 failed on fillet shape with 5-th edge.
Experimentally has been found that reducing of parameter
ChFi3d_Builder::tolesp for this task solves the issue.

So, as soluton it is proposed to link parameter toleps with parameter range of
spine curve. So, production coefficient has been set to pass all tests and
2 teset was extended: tests/blend/complex/A6, tests/bugs/modalg_7/bug22821

first has been extended to test different scaling factors,
second has been extended to make fillet on all edges from 12.

Additionally:
 - fixed misusage of tolesp in contexts where tolerance of point in 3d is excepted;
     In some context usage of tol_esp is irrelevant, because its essentiality - tolerance of the parameter on the 3d curve.
     So, in such context it has been replaced with new parameter tol3d (with fix value 1.0e-4).
     Get rid of tolapp3d duplication constant - tol_3d
 - tolesp = 5.0e-5 * (umax - umin)
 - tolesp replaced by tolpoint2d/tolpoint3d in several classes.
     Blend_Walking
     BRepBlend_SurfRstLineBuilder
     BRepBlend_RstRstLineBuilder
     Blend_CSWalking
     Instead `tolesp` - `tolgui` is employed in contexts where tolerance of guide curve parameter is excepted.
     Instead `tolesp` - `tolpoint2d` or `tolpoint3d` is employed in contexts where tolerance of point in 2d or 3d space is excepted.
 - Replace tolesp with tolpoint2d/tolpoint3d in BBPP function argument.
 - Use tolapp3d instead tolesp in BonVoisin function,
2022-12-04 13:41:29 +03:00
ddzama
2f33e34038 0032934: Modelling Algorithms - BRepExtrema_DistShapeShape returns two solutions instead of one
distmini of two edges returns two solution points instead one.
Second unneeded solution point is the same as first.

The problem was in fact that second edge has continuity C0.
In this case additional extremas analysis performed in special procedure

PERFORM_C0

And second point found in this procedure.
Folowing code of

BRepExtrema_DistanceSS::Perform (variant for Edge/Edge)

we should this additional solution extremas set
to be object of test TRI_SOLUTION before pushing
into main list of solution.
This solves the problem.
Corresponding test and compound with edges has been created.

Additionally, in the function

PERFORM_C0

an obvious error has fixed.
2022-12-04 13:39:35 +03:00
akaftasev
3eb891ec49 0033180: We had a problem calling the OCC library at the customer site, and the program crashed
Added status for thrusection operations and changed throw constructions to set of the status and break the function.
2022-12-04 13:35:24 +03:00
smoskvin
057dcfddf7 0033225: Changing the status of tests on Ubuntu 20.04 and Windows 64 VC142 2022-11-28 00:04:06 +03:00
atereshi
3837b3bf28 0033217: DRAW - Missed Standard_EXPORT attribute in DrawTrSurf_Set* functions 2022-11-25 13:03:27 +03:00
gelin
db2bfd1e83 0032818: Modeling Algorithms - Result of sweep operation is invalid
BRepFill_TrimShellCorner.cxx - setting correct orientation for NewEdge
tests/pipe/bugs/bug32818 - new test case added
2022-11-21 20:13:47 +03:00
ika
a855215141 0030256: ACIS Import - crash while importing SAT file on constructing a pipe
Fix for thin section with both first and last parameters located in one segment.
2022-11-21 20:11:13 +03:00
ifv
195aac3a42 0033193: Modeling Algorithms - Regression: UnifySameDomain raises SIGSEGV
ShapeUpgrade_UnifySameDomain.cxx - method ReconstructMissedSeam is improved.

tests/bugs/heal/bug33193 - new test case added
2022-11-21 20:10:06 +03:00
atereshi
f706dd34b3 0027122: Data Exchange - invalid shapes are produced during model translation due to huge face tolerance
Problem: The shape has two faces that dimensions are less than tolerance in the specified STEP file. This situation produces the invalid shape.
Change: Shape process has operator FixFaceSize, that is exactly suitable for this shape. The only option of FixFaceSize operator was added to InterfaceStatic, to manage the operator from DRAW command.
Result: The shape without artifacts can be reproduced from STEP file with an extra healing procedure.
2022-11-21 20:06:04 +03:00
ifv
c325231de6 0033179: Modeling Algorithms - Crash in ShapeFix_Shape with the attached object, when healing for fixing SameParameterFlag
BSplCLib_2.cxx - method MergeBSplineKnots is modified in order to have always not empty result.
Geom2dConvert.cxx - in static function MultNumandDenom tolerance for comparing knots is decreased.

tests/bugs/modalg_8/bug33179 test case added
2022-11-21 20:03:35 +03:00
ifv
91a2f58f8f 0026441: Modeling Algorithms - BRepOffset_MakeOffset affects original shape
BRepOffset_MakeOffset.cxx - tolerance control for building planar faces is implemented,
                            updating tolerance for initial entities is avoided

BRepAlgo_Loop.cxx - "total" setting tolerance 0.001 is removing

BRepLib.cxx - checking of "locked" for vertex is removing in static function UpdShTol

QABugs_20.cxx - add new command OCC26441 for checking tolerance differenses between two "identical" shapes

tests/bugs/modalg_7/bug30054 - case now is "BAD", because really result shape is invalid: many faces has not closed wires with huge gaps between ends of edges. Result was "OK" only because tolerances of vertices were increased by algorithm to cover all gaps.

tests/bugs/modalg_8/bug26441 - new test case added

Other test: B3, C8, A7, C8: they were "BAD" and now are "BAD", only some problems are changed.
2022-11-21 20:00:23 +03:00
ifv
8175a70c4e 0033173: Modeling Algorithms - Regression in BRepExtrema_DistShapeShape causing Standard_OutOfRange exception
Extrema/Extrema_ExtCC.cxx - checking number of solutions is added

tests/bugs/modalg_8/bug33173 - test case added
2022-11-21 19:57:45 +03:00
atereshi
f9990707fe 0033187: Modeling Algorithms - Crash in postprocessing of imported shape
Problem: Desynchronization of behaviors of GeomAdaptor_Curve::NbIntervals and
 GeomAdaptor_Curve::Intervals functions. First calculates number of intervals, then
 array is created and second fills the array. In some cases the size of array
 is less than need for filling.

Change:
1. Added function BSplCLib::Intervals that calculates number of interval and fills
 the array with its (if needed).
2. Simplified the algorithm of intervals calculation.
3. GeomAdaptor_Curve::NbIntervals/Intervals and Geom2dAdaptor_Curve::NbIntervals/Intervals
 use BSplCLib::Intervals.
4. When creating an adapter for the base curve, the boundaries of the adapter for the offset curve are applied.
5. Test for problem shape was created: bugs modalg_8 bug33187.

Result: The new approach eliminates the problem of writing outside the array bounds.
2022-11-21 19:53:59 +03:00
knosulko
aba5c241c6 0033144: Modeling Algorithms - Wrong result of Shape Proximity
Added step of refinement the coarser of the two shapes meshes to produce two meshes with approximately the same density.
Added tests lowalgos/proximity.

Fixed accounting of parameters to adjust number of initial sample points
2022-11-21 19:50:40 +03:00
ifv
cc164fd7dc 0033170: Modeling Algorithms - Checking for canonical geometry: plane detection problems
GeomLib_IsPlanarSurface.cxx - using poles for checking BSpline, Bezier curves and surface changed
                              on checking by curve, surface points.

BRepOffset_MakeOffset.cxx - set normal of plane surface according to normal of initial face surface

tests/cr/bugs/bug33170 - new test case added
2022-11-21 19:44:10 +03:00
ona
d7d89acb39 0032977: OCC V7.5, V7.6 cannot read STEP color correctly for the root label, but v6.8 can
- color overriding mechanism is implemented for assembles, parts and instances
2022-11-21 19:41:08 +03:00
Eugeny Maltchikov
d444cc35c6 0033171: Modeling Algorithms - Invalid result of faces unification
Avoid unification of the faces belonging to the different shells.
2022-11-21 19:38:22 +03:00
smoskvin
eeba62cbd3 Increment OCCT version up to 7.8.0dev 2022-11-12 01:20:10 +03:00
3 changed files with 237 additions and 64 deletions

View File

@@ -34,20 +34,20 @@
// Primary definitions
#define OCC_VERSION_MAJOR 7
#define OCC_VERSION_MINOR 7
#define OCC_VERSION_MAINTENANCE 1
#define OCC_VERSION_MINOR 8
#define OCC_VERSION_MAINTENANCE 0
//! This macro must be commented in official release, and set to non-empty
//! string in other situations, to identify specifics of the version, e.g.:
//! - "dev" for development version between releases
//! - "beta..." or "rc..." for beta releases or release candidates
//! - "project..." for version containing project-specific fixes
//#define OCC_VERSION_DEVELOPMENT "dev"
#define OCC_VERSION_DEVELOPMENT "dev"
// Derived (manually): version as real and string (major.minor)
#define OCC_VERSION 7.7
#define OCC_VERSION_STRING "7.7"
#define OCC_VERSION_COMPLETE "7.7.1"
#define OCC_VERSION 7.8
#define OCC_VERSION_STRING "7.8"
#define OCC_VERSION_COMPLETE "7.8.0"
//! Derived: extended version as string ("major.minor.maintenance.dev")
#ifdef OCC_VERSION_DEVELOPMENT

View File

@@ -155,8 +155,16 @@ static TopoDS_Edge MakeEdge
TopoDS_Edge E;
B.MakeEdge (E,C3D,Precision::Confusion());
B.Add (E,V1); B.Add (E,V2);
B.UpdateVertex(V1, U1, E, 0.);
B.UpdateVertex(V2, U2, E, 0.);
if (!Precision::IsPositiveInfinite(U1) &&
!Precision::IsNegativeInfinite(U1))
{
B.UpdateVertex(V1, U1, E, 0.);
}
if (!Precision::IsPositiveInfinite(U2) &&
!Precision::IsNegativeInfinite(U2))
{
B.UpdateVertex(V2, U2, E, 0.);
}
return E;
}
@@ -302,11 +310,17 @@ void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge,
// --- * a 3D Curve
// ----------------------------------------------------------
if ( C->IsKind(STANDARD_TYPE(StepGeom_Pcurve))) {
if (C->IsKind(STANDARD_TYPE(StepGeom_Pcurve)))
{
B.MakeEdge(E);
//:S4136 B.UpdateEdge (E,preci);
B.Add(E, V1);
B.Add(E, V2);
if (!V1.IsNull())
{
B.Add(E, V1);
}
if (!V2.IsNull())
{
B.Add(E, V2);
}
}
else if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve)) ) {
// For SeamCurve and IntersectionCurve types
@@ -380,6 +394,21 @@ void StepToTopoDS_TranslateEdge::MakeFromCurve3D
done = Standard_False;
return;
}
//BRep_Builder aBuilder;
//if (V1.IsNull())
//{
// TopoDS_Vertex aTmpVert;
// const Standard_Real aFirst = C1->FirstParameter();
// aBuilder.MakeVertex(aTmpVert, C1->Value(aFirst), preci);
// V1 = aTmpVert;
//}
//if (V2.IsNull())
//{
// TopoDS_Vertex aTmpVert;
// const Standard_Real aFirst = C1->LastParameter();
// aBuilder.MakeVertex(aTmpVert, C1->Value(aFirst), preci);
// V2 = aTmpVert;
//}
// -- Statistics -- -> No Warning message
aTool.AddContinuity (C1);
BRep_Builder B;

View File

@@ -22,21 +22,27 @@
// rln 02.06.99 removing #include <StepToTopoDS_DegeneratedTool.hxx>
// smh 31.01.01 BUC60810 : IsNull protection
#include <StepToTopoDS_TranslateEdgeLoop.hxx>
#include <BRep_Builder.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_Tool.hxx>
#include <ElCLib.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <gp_Dir.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <gp_Pnt.hxx>
#include <Interface_Static.hxx>
#include <Precision.hxx>
#include <ShapeAlgo.hxx>
#include <ShapeAlgo_AlgoContainer.hxx>
#include <ShapeAlgo_ToolContainer.hxx>
#include <Geom_Line.hxx>
#include <ShapeAnalysis_Curve.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeBuild_Edge.hxx>
@@ -52,13 +58,13 @@
#include <StepShape_FaceBound.hxx>
#include <StepShape_OrientedEdge.hxx>
#include <StepShape_Vertex.hxx>
#include <StepShape_VertexPoint.hxx>
#include <StepToGeom.hxx>
#include <StepToTopoDS.hxx>
#include <StepToTopoDS_GeometricTool.hxx>
#include <StepToTopoDS_NMTool.hxx>
#include <StepToTopoDS_Tool.hxx>
#include <StepToTopoDS_TranslateEdge.hxx>
#include <StepToTopoDS_TranslateEdgeLoop.hxx>
#include <StepToTopoDS_TranslateVertex.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
@@ -74,6 +80,26 @@
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
// ============================================================================
// Method : MakeCurveFromStep
// Purpose :
// ============================================================================
static Handle(Geom_Curve) MakeCurveFromStep (const Handle(StepGeom_Curve)& theStepCurve,
const Handle(Transfer_TransientProcess) theTP)
{
Handle(Geom_Curve) aResCurve = Handle(Geom_Curve)::DownCast(theTP->FindTransient(theStepCurve));
if (!aResCurve.IsNull())
{
return aResCurve;
}
aResCurve = StepToGeom::MakeCurve(theStepCurve);
if (!aResCurve.IsNull())
{
theTP->BindTransient(theStepCurve, aResCurve);
}
return aResCurve;
}
// ============================================================================
// Method : RemoveSinglePCurve
// Purpose :
@@ -220,21 +246,13 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
BRep_Builder B;
Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
Standard_Real preci = Precision();
const Standard_Real preci = Precision();
TopoDS_Wire W;
TopoDS_Edge E;
TopoDS_Vertex V;
Standard_Boolean isSeam, isLikeSeam;
Handle(Geom2d_Curve) C2d, C2d1, C2d2;
Handle(StepShape_OrientedEdge) OrEdge1, OrEdge2;
Handle(StepGeom_Curve) StepCurve, StepCurve1, StepCurve2;
Handle(StepRepr_DefinitionalRepresentation) DRI, Dri1, Dri2;
Handle(Geom2d_Curve) C2d, C2d1, C2d2, WhichC2d1, WhichC2d2;
TopoDS_Edge suspectE; //:f1, degEdge;
Standard_Integer j, NbEdge = EL->NbEdgeList();
const Standard_Integer NbEdge = EL->NbEdgeList();
if (NbEdge == 0) {
TP->AddWarning(EL, "Wire not done. EdgeLoop does not contain edges.");
done = Standard_False;
@@ -269,9 +287,9 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
// This case may not be processed, PCurves has to be recomputed from scratch
// -----------------------------------------------
// Standard_Integer theSame = 1; //gka 15.12.98
for (j=1; j<=NbEdge; j++) {
OrEdge1 = EL->EdgeListValue(j);
NCollection_Map<Handle(StepShape_OrientedEdge)> aIncorrectEdges;
for (Standard_Integer j=1; j<=NbEdge; j++) {
Handle(StepShape_OrientedEdge) OrEdge1 = EL->EdgeListValue(j);
if (OrEdge1.IsNull() || OrEdge1->EdgeElement().IsNull())
{
@@ -337,21 +355,38 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);
StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool);
if (myTranVertex1.IsDone()) {
if (myTranVertex1.IsDone())
{
V1 = TopoDS::Vertex(myTranVertex1.Value());
}
if (myTranVertex2.IsDone()) {
if (myTranVertex2.IsDone())
{
V2 = TopoDS::Vertex(myTranVertex2.Value());
gp_Pnt p1 = BRep_Tool::Pnt(V1);
gp_Pnt p2 = BRep_Tool::Pnt(V2);
if (p1.Distance(p2) <= Precision::Confusion()) { //:S4136: preci) {
Standard_Boolean Fixed = Standard_True;
if (!iseV) aTool.Bind(Vend, V1); //gka 21.08.1998 bug PRO7656
else if (!istV) aTool.Bind (Vstart, V2);
else aTool.Bind (Vend, V1);
if (!C1.IsNull() && !C1->IsClosed() && Fixed)
}
if (!V1.IsNull() && !V2.IsNull())
{
gp_Pnt aPnt1 = BRep_Tool::Pnt(V1);
gp_Pnt aPnt2 = BRep_Tool::Pnt(V2);
if (aPnt1.Distance(aPnt2) <= Precision::Confusion())
{
Standard_Boolean aIsFixed = Standard_True;
if (!iseV)
{
aTool.Bind(Vend, V1);
}
else if (!istV)
{
aTool.Bind(Vstart, V2);
}
else
{
aTool.Bind(Vend, V1);
}
if (!C1.IsNull() && !C1->IsClosed() && aIsFixed)
{
TP->AddWarning(EL->EdgeListValue(j),
"Vertex of same coordinates, set confused");
"Vertex of same coordinates, set confused");
}
}
}
}
@@ -361,32 +396,141 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
// and make it be one vertex
// NOTE: this is done only for the case if at least one of edges
// was not yet translated; else nothing will help
for (j=1; j<=NbEdge; j++) {
OrEdge1 = EL->EdgeListValue (j);
OrEdge2 = EL->EdgeListValue (j < NbEdge ? j + 1 : 1);
if (OrEdge1.IsNull() || OrEdge2.IsNull())
for (Standard_Integer anEdgeInd = 1; anEdgeInd <= NbEdge; anEdgeInd++)
{
Handle(StepShape_OrientedEdge) anOrEdge1 =
EL->EdgeListValue(anEdgeInd);
Handle(StepShape_OrientedEdge) anOrEdge2 =
EL->EdgeListValue(anEdgeInd < NbEdge ? anEdgeInd + 1 : 1);
if (anOrEdge1.IsNull() || anOrEdge2.IsNull())
continue;
Handle(StepShape_EdgeCurve) EC1 =
Handle(StepShape_EdgeCurve)::DownCast (OrEdge1->EdgeElement());
Handle(StepShape_EdgeCurve) EC2 =
Handle(StepShape_EdgeCurve)::DownCast (OrEdge2->EdgeElement());
if (EC1.IsNull() || EC2.IsNull()) // see #29979
if (!anOrEdge1->EdgeElement().IsNull() &&
anOrEdge1->EdgeElement()->IsKind(STANDARD_TYPE(StepShape_OrientedEdge)))
{
anOrEdge1 = Handle(StepShape_OrientedEdge)::DownCast(anOrEdge1->EdgeElement());
}
if (!anOrEdge2->EdgeElement().IsNull() &&
anOrEdge2->EdgeElement()->IsKind(STANDARD_TYPE(StepShape_OrientedEdge)))
{
anOrEdge2 = Handle(StepShape_OrientedEdge)::DownCast(anOrEdge2->EdgeElement());
}
Handle(StepShape_EdgeCurve) aEC1 =
Handle(StepShape_EdgeCurve)::DownCast(anOrEdge1->EdgeElement());
const Handle(StepShape_EdgeCurve) aEC2 =
Handle(StepShape_EdgeCurve)::DownCast(anOrEdge2->EdgeElement());
if (aEC1.IsNull() || aEC2.IsNull()) // see #29979
{
continue;
}
Handle(StepShape_Vertex) Vs1, Vs2, Vs11, Vs22;
Vs1 = (OrEdge1->Orientation() ? EC1->EdgeEnd() : EC1->EdgeStart());
Vs2 = (OrEdge2->Orientation() ? EC2->EdgeStart() : EC2->EdgeEnd());
Handle(StepShape_Vertex) aVs1 = anOrEdge1->Orientation() ? aEC1->EdgeEnd() : aEC1->EdgeStart();
Handle(StepShape_Vertex) aVs2 = anOrEdge2->Orientation() ? aEC2->EdgeStart() : aEC2->EdgeEnd();
Vs11 = (OrEdge1->Orientation() ? EC1->EdgeStart() : EC1->EdgeEnd());
Vs22 = (OrEdge2->Orientation() ? EC2->EdgeEnd() : EC2->EdgeStart());
Handle(StepShape_Vertex) aVs11 = anOrEdge1->Orientation() ? aEC1->EdgeStart() : aEC1->EdgeEnd();
const Handle(StepShape_Vertex) aVs22 = anOrEdge2->Orientation() ? aEC2->EdgeEnd() : aEC2->EdgeStart();
if ((Vs1 == Vs2) || (Vs1 == Vs22) || (Vs2 == Vs11) || (Vs22 == Vs11)) continue;
StepToTopoDS_TranslateVertex myTranVertex1 (Vs1, aTool, NMTool);
StepToTopoDS_TranslateVertex myTranVertex2 (Vs2, aTool, NMTool);
if (!aVs1.IsNull() && !aVs11.IsNull() &&
((aVs1 == aVs2) || (aVs1 == aVs22) || (aVs2 == aVs11) || (aVs22 == aVs11)))
{
//continue;
}
if (aVs1.IsNull())
{
aIncorrectEdges.Add(anOrEdge1);
if (aVs2.IsNull())
{
Handle(Geom_Curve) aCurve;
const Handle(Geom_Curve) aCurveFirst = MakeCurveFromStep(aEC1->EdgeGeometry(), TP);
const Handle(Geom_Curve) aCurveSecond = MakeCurveFromStep(aEC2->EdgeGeometry(), TP);
Standard_Real aLast = Precision::Infinite();
aCurve = aCurveFirst;
aLast = anOrEdge1->Orientation() ? aCurve->LastParameter() : aCurve->FirstParameter();
if (Precision::IsPositiveInfinite(aLast) ||
Precision::IsNegativeInfinite(aLast))
{
aCurve = aCurveSecond;
aLast = anOrEdge2->Orientation() ? aCurve->FirstParameter() : aCurve->LastParameter();
}
gp_Pnt aStartP;
Standard_Boolean aIsFinded = Standard_False;
if (Precision::IsPositiveInfinite(aLast) ||
Precision::IsNegativeInfinite(aLast))
{
//if (anOrEdge2->Orientation())
//{
// aLast = 0.0;
//}
//else
//{
aCurve = aCurveFirst;
Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVs22);
Handle(StepGeom_Point) P = VP->VertexGeometry();
Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint(P1);
gp_Pnt aLastPnt = P2->Pnt();
VP = Handle(StepShape_VertexPoint)::DownCast(aVs11);
P = VP->VertexGeometry();
P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
P2 = StepToGeom::MakeCartesianPoint(P1);
gp_Pnt aFirstPnt = P2->Pnt();
aLast = anOrEdge1->Orientation() ? aLastPnt.Distance(aFirstPnt) : 0.0;
if (aCurveFirst->IsKind(STANDARD_TYPE(Geom_Line)))
{
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCurveFirst);
aStartP = aFirstPnt.XYZ() + ((aLine->Position().Direction().XYZ() * aLastPnt.Distance(aFirstPnt)) * (anOrEdge1->Orientation() ? 1 : -1));
aIsFinded = Standard_True;
}
//}
}
if (!aIsFinded)
{
aStartP = aCurve->Value(aLast);
}
GeomToStep_MakeCartesianPoint aMkPoint(aStartP);
const Handle(StepGeom_CartesianPoint) aGpms = aMkPoint.Value();
const Handle(StepShape_VertexPoint) aVSP0 =
new StepShape_VertexPoint();
const Handle(TCollection_HAsciiString) aName =
new TCollection_HAsciiString("");
aVSP0->Init(aName, aGpms);
aVs2 = aVSP0;
}
if (!aVs2.IsNull())
{
aVs1 = aVs2;
if (anOrEdge1->Orientation())
{
aEC1->SetEdgeEnd(aVs1);
}
else
{
aEC1->SetEdgeStart(aVs1);
}
if (anOrEdge2->Orientation())
{
aEC2->SetEdgeStart(aVs1);
}
else
{
aEC2->SetEdgeEnd(aVs1);
}
}
}
else if (aVs2.IsNull())
{
aVs2 = aVs1;
if (anOrEdge2->Orientation())
{
aEC2->SetEdgeStart(aVs1);
}
else
{
aEC2->SetEdgeEnd(aVs1);
}
}
StepToTopoDS_TranslateVertex myTranVertex1 (aVs1, aTool, NMTool);
StepToTopoDS_TranslateVertex myTranVertex2 (aVs2, aTool, NMTool);
TopoDS_Vertex V1, V2;
if (myTranVertex1.IsDone())
@@ -400,8 +544,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
gp_Pnt p2 = BRep_Tool::Pnt(V2);
Standard_Boolean locFixed = Standard_True;
if (p1.Distance(p2) <= preci) {
if (! aTool.IsBound (EC1)) aTool.Bind (Vs1, V2);
else if (! aTool.IsBound (EC2)) aTool.Bind (Vs2, V1);
if (! aTool.IsBound (aEC1)) aTool.Bind (aVs1, V2);
else if (! aTool.IsBound (aEC2)) aTool.Bind (aVs2, V1);
else locFixed = Standard_False;
}
else locFixed = Standard_False;
@@ -413,7 +557,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
// Iteration on each Oriented Edge of the EdgeLoop
// -----------------------------------------------
for (j=1; j<=NbEdge; j++) {
for (Standard_Integer j=1; j<=NbEdge; j++) {
Standard_Boolean ThereIsLikeSeam = Standard_False;
@@ -421,7 +565,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
std::cout << " Processing Edge :" << j << std::endl;
#endif
OrEdge1 = EL->EdgeListValue(j);
Handle(StepShape_OrientedEdge) OrEdge1 = EL->EdgeListValue(j);
if (OrEdge1.IsNull() || OrEdge1->EdgeElement().IsNull())
continue;
@@ -430,7 +574,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
OrEdge1 = Handle(StepShape_OrientedEdge)::DownCast (OrEdge1->EdgeElement());
Handle(StepShape_EdgeCurve) EC = Handle(StepShape_EdgeCurve)::DownCast(OrEdge1->EdgeElement());
if (EC.IsNull())
if (EC.IsNull()/* || aIncorrectEdges.Contains(OrEdge1)*/)
{
continue;
}
@@ -458,7 +602,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
E.Orientation(TopAbs_FORWARD);
else E.Orientation(TopAbs_REVERSED);
isSeam = isLikeSeam = Standard_False;
Standard_Boolean isSeam = Standard_False;
Standard_Boolean isLikeSeam = Standard_False;
// ------------------------------------------
// Map the StepEdge parametric representation
@@ -526,7 +671,6 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
}
if (isLikeSeam) {
suspectE = E;
ThereIsLikeSeam = Standard_True;
hasPcurve = Standard_True;
}