1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

7 Commits

199 changed files with 1362 additions and 4627 deletions

View File

@@ -6271,51 +6271,41 @@ bsplineprof res
@subsubsection occt_draw_7_2_6 mkoffset
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurrences is not limited.
The offset distance defines the spacing and the positioning of the occurrences.
Syntax:
~~~~~
mkoffset result shape nboffset stepoffset [jointype(a/i) [alt]]
mkoffset result face/compound of wires nboffset stepoffset
~~~~~
where:
* *result* - the base name for the resulting wires. The index of the occurrence (starting with 1) will be added to this name, so the resulting wires will have the names - *result_1*, *result_2* ...;
* *shape* - input shape (face or compound of wires);
* *nboffset* - the number of the parallel occurrences;
* *stepoffset* - offset distance between occurrences;
* *jointype(a/i)* - join type (a for *arc* (default) and i for *intersection*);
* *alt* - altitude from the plane of the input face in relation to the normal to the face.
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
The offset distance defines the spacing and the positioning of the occurences.
**Example:**
~~~~~
# Create a box and select a face
#Create a box and select a face
box b 1 2 3
explode b f
# Create three exterior parallel contours with an offset value of 2
#Create three exterior parallel contours with an offset
value of 2
mkoffset r b_1 3 2
# wires r_1, r_2 and r_3 are created
# Create three exterior parallel contours with an offset value of 2 without round corners
mkoffset r b_1 3 2 i
# wires r_1, r_2 and r_3 are created
# Create one interior parallel contour with an offset value of 0.4
Create one interior parallel contour with an offset
value of
0.4
mkoffset r b_1 1 -0.4
~~~~~
**Note** that on a concave input contour for an interior step *mkoffset* command may produce several wires which will be contained in a single compound.
**Note** that *mkoffset* command must be used with prudence, as angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused.
**Example:**
~~~~~
# to create the example contour
profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
# creates an incoherent interior offset
# to create an incoherent interior offset
mkoffset r p 1 -0.50
==p is not a FACE but a WIRE
BRepFill_TrimEdgeTool: incoherent intersection
# to create two incoherent wires
mkoffset r p 1 -0.50
# creates two incoherent wires
mkoffset r p 1 -0.55
# r_1 is a compound of two wires
~~~~~
@subsubsection occt_draw_7_2_7 mkplane, mkface

View File

@@ -128,7 +128,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
switch (aMode)
switch (aMode)
{
case 0:
const TColgp_Array1OfPnt& nodes = myTriangulation->Nodes(); //Nodes
@@ -203,7 +203,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
//=======================================================================
//function : ComputeSelection
//purpose :
//purpose :
//=======================================================================
void AIS_Triangulation::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
@@ -238,7 +238,7 @@ Handle(TColStd_HArray1OfInteger) AIS_Triangulation::GetColors() const
//=======================================================================
//function : SetTriangulation
//purpose :
//purpose :
//=======================================================================
void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTriangulation)
{
@@ -247,7 +247,7 @@ void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTria
//=======================================================================
//function : GetTriangulation
//purpose :
//purpose :
//=======================================================================
Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
return myTriangulation;
@@ -255,19 +255,25 @@ Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
//=======================================================================
//function : AttenuateColor
//purpose :
//purpose : Attenuates 32-bit color by a given attenuation factor (0...1):
// aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
// All color components are multiplied by aComponent, the result is then packed again as 32-bit integer.
// Color attenuation is applied to the vertex colors in order to have correct visual result
// after glColorMaterial(GL_AMBIENT_AND_DIFFUSE). Without it, colors look unnatural and flat.
//=======================================================================
Graphic3d_Vec4ub AIS_Triangulation::attenuateColor (const Standard_Integer theColor,
const Standard_Real theComposition)
{
const Standard_Byte* anRgbx = reinterpret_cast<const Standard_Byte*> (&theColor);
const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub*> (&theColor);
// If IsTranparent() is false alpha value will be ignored anyway.
Standard_Byte anAlpha = IsTransparent() ? static_cast<Standard_Byte> (255.0 - myDrawer->ShadingAspect()->Aspect()->FrontMaterial().Transparency() * 255.0)
: 255;
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * anRgbx[0]),
(Standard_Byte)(theComposition * anRgbx[1]),
(Standard_Byte)(theComposition * anRgbx[2]),
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * aColor.r()),
(Standard_Byte)(theComposition * aColor.g()),
(Standard_Byte)(theComposition * aColor.b()),
anAlpha);
}

View File

@@ -17,7 +17,6 @@
#include <AdvApp2Var_Data_f2c.hxx>
#include <AdvApp2Var_MathBase.hxx>
#include <AdvApp2Var_Data.hxx>
#include <NCollection_Array1.hxx>
// statics
static
@@ -121,11 +120,11 @@ int mmdrvcb_(integer *ideriv,
static
int mmexthi_(integer *ndegre,
NCollection_Array1<doublereal>& hwgaus);
doublereal *hwgaus);
static
int mmextrl_(integer *ndegre,
NCollection_Array1<doublereal>& rootlg);
doublereal *rootlg);
@@ -153,7 +152,7 @@ int mmpojac_(doublereal *tparam,
integer *iordre,
integer *ncoeff,
integer *nderiv,
NCollection_Array1<doublereal>& valjac,
doublereal *valjac,
integer *iercod);
static
@@ -3765,7 +3764,7 @@ int AdvApp2Var_MathBase::mmeps1_(doublereal *epsilo)
//purpose :
//=======================================================================
int mmexthi_(integer *ndegre,
NCollection_Array1<doublereal>& hwgaus)
doublereal *hwgaus)
{
/* System generated locals */
@@ -3856,6 +3855,8 @@ int mmexthi_(integer *ndegre,
/************************************************************************
*****/
/* Parameter adjustments */
--hwgaus;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
@@ -3881,7 +3882,7 @@ int mmexthi_(integer *ndegre,
i__1 = *ndegre;
for (ii = ideb; ii <= i__1; ++ii) {
kpt = iadd + ii - ideb;
hwgaus(ii) = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
hwgaus[ii] = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
/* L100: */
}
@@ -3890,7 +3891,7 @@ int mmexthi_(integer *ndegre,
i__1 = ndeg2;
for (ii = 1; ii <= i__1; ++ii) {
hwgaus(ii) = hwgaus(*ndegre + 1 - ii);
hwgaus[ii] = hwgaus[*ndegre + 1 - ii];
/* L200: */
}
@@ -3898,7 +3899,7 @@ int mmexthi_(integer *ndegre,
/* associated Gauss weights are loaded. */
if (nmod2 == 1) {
hwgaus(ndeg2 + 1) = mlgdrtl_.hi0tab[ndeg2];
hwgaus[ndeg2 + 1] = mlgdrtl_.hi0tab[ndeg2];
}
/* --------------------------- The end ----------------------------------
@@ -3915,7 +3916,7 @@ int mmexthi_(integer *ndegre,
//purpose :
//=======================================================================
int mmextrl_(integer *ndegre,
NCollection_Array1<doublereal>& rootlg)
doublereal *rootlg)
{
/* System generated locals */
integer i__1;
@@ -4001,6 +4002,8 @@ int mmextrl_(integer *ndegre,
/************************************************************************
*****/
/* Parameter adjustments */
--rootlg;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
@@ -4026,7 +4029,7 @@ int mmextrl_(integer *ndegre,
i__1 = *ndegre;
for (ii = ideb; ii <= i__1; ++ii) {
kpt = iadd + ii - ideb;
rootlg(ii) = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
rootlg[ii] = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
/* L100: */
}
@@ -4037,14 +4040,14 @@ int mmextrl_(integer *ndegre,
i__1 = ndeg2;
for (ii = 1; ii <= i__1; ++ii) {
rootlg(ii) = -rootlg(*ndegre + 1 - ii);
rootlg[ii] = -rootlg[*ndegre + 1 - ii];
/* L200: */
}
/* Case NDEGRE uneven, 0 is root of Legendre polynom. */
if (nmod2 == 1) {
rootlg(ndeg2 + 1) = 0.;
rootlg[ndeg2 + 1] = 0.;
}
/* -------------------------------- THE END -----------------------------
@@ -6587,8 +6590,7 @@ L9900:
integer valbas_dim1, i__1;
/* Local variables */
doublereal vjacc[80], herm[24];
NCollection_Array1<doublereal> vjac (vjacc[0], 1, 80);
doublereal vjac[80], herm[24];
integer iord[2];
doublereal wval[4];
integer nwcof, iunit;
@@ -6783,7 +6785,7 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac] = wval[0] * vjac(ii);
valbas[ii + iorjac] = wval[0] * vjac[ii - 1];
}
/* (3) Evaluation of order 1 */
@@ -6799,8 +6801,8 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac(ii + kk1)
+ wval[1] * vjac(ii);
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac[ii + kk1 - 1]
+ wval[1] * vjac[ii - 1];
}
}
@@ -6816,9 +6818,9 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac(ii +
kk2) + wval[1] * 2 * vjac(ii + kk1) + wval[2] *
vjac(ii);
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac[ii +
kk2 - 1] + wval[1] * 2 * vjac[ii + kk1 - 1] + wval[2] *
vjac[ii - 1];
}
}
@@ -6834,9 +6836,9 @@ L9900:
i__1 = kk1;
for (ii = 1; ii <= i__1; ++ii) {
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac(ii + kk3)
+ wval[1] * 3 * vjac(ii + kk2) + wval[2] * 3 *
vjac(ii + kk1) + wval[3] * vjac(ii);
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac[ii + kk3 -
1] + wval[1] * 3 * vjac[ii + kk2 - 1] + wval[2] * 3 *
vjac[ii + kk1 - 1] + wval[3] * vjac[ii - 1];
}
}
@@ -7090,7 +7092,7 @@ int mmpojac_(doublereal *tparam,
integer *iordre,
integer *ncoeff,
integer *nderiv,
NCollection_Array1<doublereal>& valjac,
doublereal *valjac,
integer *iercod)
{
@@ -7165,6 +7167,7 @@ int mmpojac_(doublereal *tparam,
/* Parameter adjustments */
valjac_dim1 = *ncoeff;
--valjac;
/* Function Body */
@@ -7210,21 +7213,21 @@ int mmpojac_(doublereal *tparam,
/* --- Trivial Positions ----- */
valjac(1) = 1.;
valjac[1] = 1.;
aux1 = (doublereal) (*iordre + 1);
valjac(2) = aux1 * *tparam;
valjac[2] = aux1 * *tparam;
if (*nderiv >= 1) {
valjac(valjac_dim1 + 1) = 0.;
valjac(valjac_dim1 + 2) = aux1;
valjac[valjac_dim1 + 1] = 0.;
valjac[valjac_dim1 + 2] = aux1;
if (*nderiv >= 2) {
valjac((valjac_dim1 << 1) + 1) = 0.;
valjac((valjac_dim1 << 1) + 2) = 0.;
valjac[(valjac_dim1 << 1) + 1] = 0.;
valjac[(valjac_dim1 << 1) + 2] = 0.;
if (*nderiv >= 3) {
valjac(valjac_dim1 * 3 + 1) = 0.;
valjac(valjac_dim1 * 3 + 2) = 0.;
valjac[valjac_dim1 * 3 + 1] = 0.;
valjac[valjac_dim1 * 3 + 2] = 0.;
}
}
}
@@ -7244,26 +7247,26 @@ int mmpojac_(doublereal *tparam,
denom = 1. / denom;
/* --> Pi(t) */
valjac(ii) = (cofa * *tparam * valjac(kk1) + cofb * valjac(kk2)) *
valjac[ii] = (cofa * *tparam * valjac[kk1] + cofb * valjac[kk2]) *
denom;
/* --> P'i(t) */
if (*nderiv >= 1) {
valjac(ii + valjac_dim1) = (cofa * *tparam * valjac(kk1 +
valjac_dim1) + cofa * valjac(kk1) + cofb * valjac(kk2 +
valjac_dim1)) * denom;
valjac[ii + valjac_dim1] = (cofa * *tparam * valjac[kk1 +
valjac_dim1] + cofa * valjac[kk1] + cofb * valjac[kk2 +
valjac_dim1]) * denom;
/* --> P''i(t) */
if (*nderiv >= 2) {
valjac(ii + (valjac_dim1 << 1)) = (cofa * *tparam * valjac(
kk1 + (valjac_dim1 << 1)) + cofa * 2 * valjac(kk1 +
valjac_dim1) + cofb * valjac(kk2 + (valjac_dim1 << 1))
valjac[ii + (valjac_dim1 << 1)] = (cofa * *tparam * valjac[
kk1 + (valjac_dim1 << 1)] + cofa * 2 * valjac[kk1 +
valjac_dim1] + cofb * valjac[kk2 + (valjac_dim1 << 1)]
) * denom;
}
/* --> P'i(t) */
if (*nderiv >= 3) {
valjac(ii + valjac_dim1 * 3) = (cofa * *tparam * valjac(kk1 +
valjac_dim1 * 3) + cofa * 3 * valjac(kk1 + (
valjac_dim1 << 1)) + cofb * valjac(kk2 + valjac_dim1 *
3)) * denom;
valjac[ii + valjac_dim1 * 3] = (cofa * *tparam * valjac[kk1 +
valjac_dim1 * 3] + cofa * 3 * valjac[kk1 + (
valjac_dim1 << 1)] + cofb * valjac[kk2 + valjac_dim1 *
3]) * denom;
}
}
}
@@ -7274,8 +7277,8 @@ int mmpojac_(doublereal *tparam,
for (ii = 1; ii <= i__1; ++ii) {
i__2 = *nderiv;
for (jj = 0; jj <= i__2; ++jj) {
valjac(ii + jj * valjac_dim1) = tnorm[ii - 1] * valjac(ii + jj *
valjac_dim1);
valjac[ii + jj * valjac_dim1] = tnorm[ii - 1] * valjac[ii + jj *
valjac_dim1];
}
}
@@ -10655,8 +10658,7 @@ int mvgaus0_(integer *kindic,
integer i__1;
/* Local variables */
doublereal tampc[40];
NCollection_Array1<doublereal> tamp (tampc[0], 1, 40);
doublereal tamp[40];
integer ndegl, kg, ii;
/* **********************************************************************
@@ -10749,7 +10751,7 @@ int mvgaus0_(integer *kindic,
mmextrl_(&ndegl, tamp);
i__1 = *nbrval;
for (ii = 1; ii <= i__1; ++ii) {
urootl[ii] = -tamp(ii);
urootl[ii] = -tamp[ii - 1];
/* L100: */
}
@@ -10760,7 +10762,7 @@ int mvgaus0_(integer *kindic,
mmexthi_(&ndegl, tamp);
i__1 = *nbrval;
for (ii = 1; ii <= i__1; ++ii) {
hiltab[ii] = tamp(ii);
hiltab[ii] = tamp[ii - 1];
/* L200: */
}

View File

@@ -3248,8 +3248,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
const Standard_Boolean UpdatePCurve,
const Standard_Boolean enlargeU,
const Standard_Boolean enlargeVfirst,
const Standard_Boolean enlargeVlast,
const Standard_Boolean UseInfini)
const Standard_Boolean enlargeVlast)
{
//---------------------------
// extension de la geometrie.
@@ -3271,20 +3270,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
S->Bounds (US1,US2,VS1,VS2);
if (UseInfini)
{
UU1 = VV1 = - TheInfini;
UU2 = VV2 = TheInfini;
}
else
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - FaceDU;
UU2 = UF2 + FaceDU;
VV1 = VF1 - FaceDV;
VV2 = VF2 + FaceDV;
}
UU1 = VV1 = - TheInfini;
UU2 = VV2 = TheInfini;
if (CanExtentSurface) {
SurfaceChange = EnlargeGeometry( S, UU1, UU2, VV1, VV2, isVV1degen, isVV2degen, UF1, UF2, VF1, VF2,
@@ -4161,4 +4148,4 @@ void PerformPlanes(const TopoDS_Face& theFace1,
Standard_Boolean IsInf(const Standard_Real theVal)
{
return (theVal > TheInfini*0.9);
}
}

View File

@@ -104,14 +104,7 @@ public:
//! if <UpdatePCurve> is TRUE, update the pcurves of the
//! edges of <F> on the new surface.if the surface has been changed,
//! Returns True if The Surface of <NF> has changed.
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F,
TopoDS_Face& NF,
const Standard_Boolean ChangeGeom,
const Standard_Boolean UpDatePCurve = Standard_False,
const Standard_Boolean enlargeU = Standard_True,
const Standard_Boolean enlargeVfirst = Standard_True,
const Standard_Boolean enlargeVlast = Standard_True,
const Standard_Boolean UseInfini = Standard_True);
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);

View File

@@ -1,780 +0,0 @@
// Created on: 2012-08-06
// Created by: jgv@ROLEX
// Copyright (c) 2012-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepOffsetAPI_PatchFaces.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_HSurface.hxx>
#include <BRepTopAdaptor_TopolTool.hxx>
#include <LocalAnalysis_SurfaceContinuity.hxx>
#include <TopOpeBRepTool_TOOL.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
#include <IntTools_Context.hxx>
#include <BOPTools_AlgoTools.hxx>
#include <BRepOffset_Tool.hxx>
#include <ShapeAnalysis_Surface.hxx>
#include <ShapeConstruct_ProjectCurveOnSurface.hxx>
#include <BRepAlgoAPI_Section.hxx>
#include <Extrema_ExtPC.hxx>
#include <BRepExtrema_ExtCC.hxx>
#include <ShapeFix_Shape.hxx>
static TopoDS_Edge MakeNewEdgeWithOldPcurvesOnNewSurfaces(const TopoDS_Edge& theEdge,
const TopoDS_Face& theOldFace1,
const TopoDS_Face& theNewFace1,
const TopoDS_Face& theOldFace2,
const TopoDS_Face& theNewFace2)
{
TopoDS_Edge aNewEdge;
Standard_Real fpar, lpar;
BRep_Builder BB;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, fpar, lpar);
aNewEdge = BRepLib_MakeEdge(aCurve, aCurve->FirstParameter(), aCurve->LastParameter()); //???
TopoDS_Vertex V1, V2;
TopExp::Vertices(aNewEdge, V1, V2);
aNewEdge.Free(Standard_True);
BB.Remove(aNewEdge, V1);
BB.Remove(aNewEdge, V2);
Standard_Real Etol = BRep_Tool::Tolerance(theEdge);
Handle(Geom2d_Curve) aPCurve1 = BRep_Tool::CurveOnSurface(theEdge, theOldFace1, fpar, lpar);
BB.UpdateEdge(aNewEdge, aPCurve1, theNewFace1, Etol);
Handle(Geom2d_Curve) aPCurve2 = BRep_Tool::CurveOnSurface(theEdge, theOldFace2, fpar, lpar);
BB.UpdateEdge(aNewEdge, aPCurve2, theNewFace2, Etol);
return aNewEdge;
}
static void UpdateEdgeByProjectionOfPCurve(TopoDS_Edge& anEdge,
const TopoDS_Face& aNewFace,
const TopoDS_Face& aBoundedNewFace)
{
BRep_Builder BB;
Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,fpar,lpar);
Handle(Geom_Surface) NewSurf = BRep_Tool::Surface(aNewFace);
Handle(ShapeAnalysis_Surface) SAS = new ShapeAnalysis_Surface(NewSurf);
ShapeConstruct_ProjectCurveOnSurface aToolProj;
aToolProj.Init(SAS, Precision::Confusion());
Handle(Geom2d_Curve) NewPCurve;
aToolProj.Perform(aCurve,fpar,lpar,NewPCurve);
Standard_Real TolReached = SAS->Gap();
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
BB.UpdateEdge(anEdge, NewPCurve, aBoundedNewFace, TolReached);
TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2);
BB.UpdateVertex(V1, TolReached);
BB.UpdateVertex(V2, TolReached);
}
static void ProjectVertexOnNewEdge(const TopoDS_Vertex& theVertex,
const TopoDS_Edge& theEdge,
const TopoDS_Edge& theNewEdge,
Standard_Real& theParam,
gp_Pnt& thePnt,
Standard_Real& theTolReached)
{
Standard_Real ParamOnEdge = BRep_Tool::Parameter(theVertex, theEdge);
BRepAdaptor_Curve BAcurve(theEdge);
BRepAdaptor_Curve BAnewcurve(theNewEdge);
gp_Pnt PointOnEdge = BAcurve.Value(ParamOnEdge);
Extrema_ExtPC Projector(PointOnEdge, BAnewcurve);
Standard_Real Param[4], dist[4];
gp_Pnt Pnt[4];
Param[1] = BAnewcurve.FirstParameter();
Param[2] = BAnewcurve.LastParameter();
Projector.TrimmedSquareDistances(dist[1], dist[2], Pnt[1], Pnt[2]);
dist[3] = RealLast();
if (Projector.IsDone() && Projector.NbExt() > 0)
{
Standard_Integer imin = 1;
for (Standard_Integer i = 2; i <= Projector.NbExt(); i++)
if (Projector.SquareDistance(i) < Projector.SquareDistance(imin))
imin = i;
Param[3] = Projector.Point(imin).Parameter();
dist[3] = Projector.SquareDistance(imin);
Pnt[3] = Projector.Point(imin).Value();
}
Standard_Integer imin = 1;
for (Standard_Integer i = 2; i <= 3; i++)
if (dist[i] < dist[imin])
imin = i;
theParam = Param[imin];
thePnt = Pnt[imin];
theTolReached = sqrt(dist[imin]);
}
static TopoDS_Edge GetGeneratedEdge(const TopoDS_Edge& anEdge,
const TopoDS_Face& aFace,
const TopoDS_Face& aNewFace)
{
TopoDS_Edge aNewEdge;
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
TopExp_Explorer ExploNew(aNewFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next(),ExploNew.Next())
{
const TopoDS_Shape& EdgeInFace = Explo.Current();
//const TopoDS_Shape& EdgeInNewFace = ExploNew.Current();
if (anEdge == EdgeInFace)
{
aNewEdge = TopoDS::Edge(ExploNew.Current());
break;
}
}
TopoDS_Vertex V1, V2;
TopExp::Vertices(aNewEdge, V1, V2);
BRep_Builder BB;
aNewEdge.Free(Standard_True);
BB.Remove(aNewEdge, V1);
BB.Remove(aNewEdge, V2);
return aNewEdge;
}
static TopAbs_Orientation OrientationInEdge(const TopoDS_Vertex& theVertex,
const TopoDS_Edge& theEdge)
{
TopoDS_Vertex V1, V2;
TopExp::Vertices(theEdge, V1, V2);
if (theVertex.IsSame(V1))
return TopAbs_FORWARD;
return TopAbs_REVERSED;
}
static Standard_Boolean EdgeContains(const TopoDS_Edge& theEdge,
const TopoDS_Vertex& theVertex)
{
TopoDS_Iterator ite(theEdge);
for (; ite.More(); ite.Next())
if (theVertex.IsSame(ite.Value()))
return Standard_True;
return Standard_False;
}
static Standard_Boolean IsTangentFaces(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const GeomAbs_Shape Order)
{
if (Order == GeomAbs_G1 &&
BRep_Tool::Continuity( theEdge, theFace1, theFace2 ) != GeomAbs_C0)
return Standard_True;
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
Standard_Real aFirst;
Standard_Real aLast;
// Obtaining of pcurves of edge on two faces.
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
(theEdge, theFace1, aFirst, aLast);
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
(theEdge, theFace2, aFirst, aLast);
if (aC2d1.IsNull() || aC2d2.IsNull())
return Standard_False;
// Obtaining of two surfaces from adjacent faces.
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
if (aSurf1.IsNull() || aSurf2.IsNull())
return Standard_False;
// Computation of the number of samples on the edge.
BRepAdaptor_Surface aBAS1(theFace1);
BRepAdaptor_Surface aBAS2(theFace2);
Handle(BRepAdaptor_HSurface) aBAHS1 = new BRepAdaptor_HSurface(aBAS1);
Handle(BRepAdaptor_HSurface) aBAHS2 = new BRepAdaptor_HSurface(aBAS2);
Handle(BRepTopAdaptor_TopolTool) aTool1 = new BRepTopAdaptor_TopolTool(aBAHS1);
Handle(BRepTopAdaptor_TopolTool) aTool2 = new BRepTopAdaptor_TopolTool(aBAHS2);
Standard_Integer aNbSamples1 = aTool1->NbSamples();
Standard_Integer aNbSamples2 = aTool2->NbSamples();
const Standard_Integer aNbSamplesMax = 23;
Standard_Integer aNbSamples = Min(aNbSamplesMax, Max(aNbSamples1, aNbSamples2));
const Standard_Real aTolAngle = M_PI/18;
// Computation of the continuity.
Standard_Real aPar;
Standard_Real aDelta = (aLast - aFirst)/(aNbSamples - 1);
Standard_Integer i, nbNotDone = 0;
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta) {
if (i == aNbSamples) aPar = aLast;
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
aSurf1, aSurf2, Order,
0.001, TolC0, aTolAngle, 0.1, 0.1);
if (!aCont.IsDone())
{
nbNotDone++;
continue;
}
if (Order == GeomAbs_G1)
{
if (!aCont.IsG1())
return Standard_False;
}
else if (!aCont.IsG2())
return Standard_False;
}
if (nbNotDone == aNbSamples)
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : BRepOffsetAPI_PatchFaces
//purpose : Constructor
//=======================================================================
BRepOffsetAPI_PatchFaces::BRepOffsetAPI_PatchFaces(const TopoDS_Shape& theShape)
{
myInitialShape = theShape;
}
//=======================================================================
//function : SetOffsetFace
//purpose :
//=======================================================================
void BRepOffsetAPI_PatchFaces::AddPatchFace(const TopoDS_Face& theFace,
const TopoDS_Face& thePatchFace)
{
// Check the orientation of the patch face and make
// it oriented the same way as original
TopoDS_Face aFace = TopoDS::Face(theFace.Oriented(TopAbs_FORWARD));
TopoDS_Face aPatchFace = TopoDS::Face(thePatchFace.Oriented(TopAbs_FORWARD));
Handle(IntTools_Context) aCtx = new IntTools_Context;
Standard_Boolean bToReverse = BOPTools_AlgoTools::IsSplitToReverse(aFace, aPatchFace, aCtx);
TopoDS_Face anOrientedPatchFace = bToReverse ? TopoDS::Face(aPatchFace.Reversed()) : aPatchFace;
myFacePatchFace.Add(aFace, anOrientedPatchFace);
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepOffsetAPI_PatchFaces::Build()
{
TopExp::MapShapesAndUniqueAncestors(myInitialShape, TopAbs_EDGE, TopAbs_FACE, myEFmap);
//Draft filling of <myFaceNewFace>
for (Standard_Integer i = 1; i <= myFacePatchFace.Extent(); i++)
{
const TopoDS_Face& aFace = TopoDS::Face(myFacePatchFace.FindKey(i));
const TopoDS_Shape& aPatchFace = myFacePatchFace(i);
myFaceNewFace.Add(aFace, aPatchFace);
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
if (myFacePatchFace.Contains(aNeighborFace))
continue;
if (myFaceNewFace.Contains(aNeighborFace))
continue;
Standard_Boolean IsTangentEdge = IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1);
if (IsTangentEdge)
{
myTangentEdges.Add(anEdge);
continue;
}
aNeighborFace.Orientation(TopAbs_FORWARD);
TopoDS_Face aNewFace;
BRepOffset_Tool::EnLargeFace(aNeighborFace, aNewFace,
Standard_True,Standard_True,Standard_True,Standard_True,Standard_True,
Standard_False); //not too big
myFaceNewFace.Add(aNeighborFace, aNewFace);
}
}
//Make draft intersection edges: draft filling of <myEdgeNewEdge>
BRep_Builder BB;
TopTools_MapOfShape UpdatedConstEdges;
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
{
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
TopoDS_Face aNewFace = TopoDS::Face(myFaceNewFace(i));
TopoDS_Face aBoundedNewFace;
if (myNewFaceBoundedFace.IsBound(aNewFace))
aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
else
{
aBoundedNewFace = TopoDS::Face(aNewFace.EmptyCopied());
myNewFaceBoundedFace.Bind(aNewFace, aBoundedNewFace);
}
TopoDS_Iterator itf(aFace);
for (; itf.More(); itf.Next())
{
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
BRepTools_WireExplorer wexp(F_Wire, aFace);
for (; wexp.More(); wexp.Next())
{
TopoDS_Edge anEdge = wexp.Current();
Standard_Boolean ToReverse = Standard_False;
TopoDS_Edge aNewEdge;
if (myEdgeNewEdge.IsBound(anEdge))
//aNewEdge = TopoDS::Edge(myEdgeNewEdge(anEdge));
continue;
Handle(Geom2d_Curve) NullPCurve;
Standard_Real fpar, lpar;
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
if (Lfaces.Extent() == 1) //seam edge
{
cout<<endl<<"Seam edge or degenerated edge !!!"<<endl;
TopoDS_Edge GeneratedEdge = GetGeneratedEdge(anEdge, aFace, aNewFace);
myOrientedEdgeNewEdge.Bind(anEdge, GeneratedEdge);
continue;
}
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
if (myTangentEdges.Contains(anEdge)&&
!UpdatedConstEdges.Contains(anEdge)) //project onto patch
{
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
//aNewEdge = anEdge;
UpdatedConstEdges.Add(anEdge);
continue;
}
if (myFaceNewFace.Contains(aNeighborFace))//intersect
{
TopoDS_Face aNewNeighborFace = TopoDS::Face(myFaceNewFace.FindFromKey(aNeighborFace));
TopoDS_Face aBoundedNewNeighborFace;
if (myNewFaceBoundedFace.IsBound(aNewNeighborFace))
aBoundedNewNeighborFace = TopoDS::Face(myNewFaceBoundedFace(aNewNeighborFace));
else
{
aBoundedNewNeighborFace = TopoDS::Face(aNewNeighborFace.EmptyCopied());
myNewFaceBoundedFace.Bind(aNewNeighborFace, aBoundedNewNeighborFace);
}
if (!myFacePatchFace.Contains(aFace) &&
!myFacePatchFace.Contains(aNeighborFace) &&
IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1)) //smooth edge
{
//make new edge with pcurves on new surfaces
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
aFace, aBoundedNewFace,
aNeighborFace, aBoundedNewNeighborFace);
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
continue;
}
BRepLib::BuildCurves3d(aNewFace);
BRepLib::BuildCurves3d(aNewNeighborFace);
BRepAlgoAPI_Section SecBuilder(aNewFace, aNewNeighborFace, Standard_False);
SecBuilder.Approximation(Standard_True);
SecBuilder.ComputePCurveOn1(Standard_True);
SecBuilder.ComputePCurveOn2(Standard_True);
SecBuilder.Build();
TopoDS_Shape aSection = SecBuilder.Shape();
Standard_Boolean Success = Standard_True;
TopExp_Explorer ExpSec(aSection, TopAbs_EDGE);
if (ExpSec.More())
aNewEdge = TopoDS::Edge(ExpSec.Current());
else //no intersection
{
cout<<endl<<"No intersecion => smooth edge"<<endl;
Success = Standard_False;
}
ExpSec.Next();
if (ExpSec.More())
{
cout<<endl<<"More than one intersecion => smooth edge"<<endl;
Success = Standard_False;
}
if (!Success) //a smooth edge with bigger angle
{
if (myFacePatchFace.Contains(aFace)) //project onto patch
{
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
//Remove neighbor face from <myFaceNewFace>
myFaceNewFace.RemoveKey(aNeighborFace);
myTangentEdges.Add(anEdge);
UpdatedConstEdges.Add(anEdge);
}
else
{
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
aFace, aBoundedNewFace,
aNeighborFace, aBoundedNewNeighborFace);
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
}
continue;
}
TopoDS_Vertex V1, V2;
TopExp::Vertices(aNewEdge, V1, V2);
aNewEdge.Free(Standard_True);
BB.Remove(aNewEdge, V1);
BB.Remove(aNewEdge, V2);
aNewEdge.Orientation(TopAbs_FORWARD);
//Make pcurves on new surfaces
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(aNewEdge, aNewFace, fpar, lpar);
BB.UpdateEdge(aNewEdge, NullPCurve, aNewFace, 0.);
BB.UpdateEdge(aNewEdge, PCurve1, aBoundedNewFace, 0.);
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(aNewEdge, aNewNeighborFace, fpar, lpar);
BB.UpdateEdge(aNewEdge, NullPCurve, aNewNeighborFace, 0.);
BB.UpdateEdge(aNewEdge, PCurve2, aBoundedNewNeighborFace, 0.);
//Check orientation of new edge
BRepAdaptor_Curve BAcurve(anEdge);
BRepAdaptor_Curve BAnewcurve(aNewEdge);
gp_Pnt FirstPnt, FirstNewPnt;
gp_Vec DirOnCurve, DirOnNewCurve;
BAcurve.D1(BAcurve.FirstParameter(), FirstPnt, DirOnCurve);
Standard_Real ParamOnNewEdge = BAnewcurve.FirstParameter();
Extrema_ExtPC Projector(FirstPnt, BAnewcurve);
if (!Projector.IsDone() || Projector.NbExt() == 0)
{
cout<<endl<<"Define orientation of new edge: extrema point-curve is not done"<<endl;
}
if (Projector.IsDone() && Projector.NbExt() > 0)
{
Standard_Integer indmin = 1;
for (Standard_Integer ind = 2; ind <= Projector.NbExt(); ind++)
if (Projector.SquareDistance(ind) < Projector.SquareDistance(indmin))
indmin = ind;
ParamOnNewEdge = Projector.Point(indmin).Parameter();
}
BAnewcurve.D1(ParamOnNewEdge, FirstNewPnt, DirOnNewCurve);
Standard_Real ScalProd = DirOnCurve * DirOnNewCurve;
if (ScalProd < 0.)
ToReverse = Standard_True;
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD),
(ToReverse)? aNewEdge.Oriented(TopAbs_REVERSED) : aNewEdge);
} //intersect
else //borders on constant face: change surface of pcurve on existing edge
{
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, fpar, lpar);
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
BB.UpdateEdge(anEdge, aPCurve, aBoundedNewFace, 0.);
aNewEdge = anEdge;
}
} //for (; wexp.More(); wexp.Next())
} //for (; itf.More(); itf.Next())
} //for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
//Intersect edges and make new wires
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
{
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
TopoDS_Shape aNewFace = myFaceNewFace(i);
TopoDS_Face aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
TopoDS_Iterator itf(aFace);
for (; itf.More(); itf.Next())
{
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
TopAbs_Orientation aWireOr = aWire.Orientation();
TopoDS_Wire aNewWire;
BB.MakeWire(aNewWire);
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
BRepTools_WireExplorer wexp(F_Wire, aFace);
TopoDS_Vertex CurVertex = wexp.CurrentVertex();
TopoDS_Edge FirstEdge = wexp.Current();
TopoDS_Edge FirstNewEdge = FirstEdge;
if (myOrientedEdgeNewEdge.IsBound(FirstEdge))
FirstNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(FirstEdge));
else if (myEdgeNewEdge.IsBound(FirstEdge))
FirstNewEdge = TopoDS::Edge(myEdgeNewEdge(FirstEdge));
TopoDS_Edge CurEdge, PrevEdge = FirstEdge;
TopoDS_Edge CurNewEdge, PrevNewEdge = FirstNewEdge;
wexp.Next();
if (!wexp.More() && //only one edge in wire
!myVertexNewVertex.IsBound(CurVertex))
{
TopoDS_Vertex CurNewVertex;
if (myVertexNewVertex.IsBound(CurVertex))
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(CurVertex));
if (myEdgeNewEdge.IsBound(FirstEdge))//new edge: update
{
Standard_Real fpar, lpar;
BRep_Tool::Range(FirstEdge, fpar, lpar);
BB.Range(FirstNewEdge, fpar, lpar);
BRepAdaptor_Curve BAcurve(FirstNewEdge);
gp_Pnt FirstPnt = BAcurve.Value(BAcurve.FirstParameter());
if (CurNewVertex.IsNull())
CurNewVertex = BRepLib_MakeVertex(FirstPnt);
BB.Add(FirstNewEdge, CurNewVertex);
BB.Add(FirstNewEdge, CurNewVertex.Oriented(TopAbs_REVERSED));
myVertexNewVertex.Bind(CurVertex, CurNewVertex);
}
}
for (; wexp.More(); wexp.Next())
{
CurEdge = wexp.Current();
if (myOrientedEdgeNewEdge.IsBound(CurEdge))
CurNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(CurEdge));
else if (myEdgeNewEdge.IsBound(CurEdge))
CurNewEdge = TopoDS::Edge(myEdgeNewEdge(CurEdge));
else
CurNewEdge = CurEdge;
CurVertex = wexp.CurrentVertex();
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
CurEdge, CurNewEdge,
CurVertex);
if (!PrevEdge.IsSame(PrevNewEdge) &&
PrevEdge.Orientation() == TopAbs_REVERSED)
PrevNewEdge.Reverse();
BB.Add(aNewWire, PrevNewEdge);
PrevEdge = CurEdge;
PrevNewEdge = CurNewEdge;
}
CurEdge = FirstEdge;
CurNewEdge = FirstNewEdge;
CurVertex = wexp.CurrentVertex();
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
CurEdge, CurNewEdge,
CurVertex);
if (!PrevEdge.IsSame(PrevNewEdge) &&
PrevEdge.Orientation() == TopAbs_REVERSED)
PrevNewEdge.Reverse();
BB.Add(aNewWire, PrevNewEdge);
aNewWire.Orientation(aWireOr);
BB.Add(aBoundedNewFace, aNewWire);
} //for (; itf.More(); itf.Next()) (iterator on face)
}
//Assemble resulting shape
TopoDS_Solid aSolid;
BB.MakeSolid(aSolid);
TopoDS_Shell aShell;
BB.MakeShell(aShell);
TopExp_Explorer Explo(myInitialShape, TopAbs_FACE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Shape& aFace = Explo.Current();
TopoDS_Shape aBoundedNewFace;
if (myFaceNewFace.Contains(aFace))
{
const TopoDS_Shape& aNewFace = myFaceNewFace.FindFromKey(aFace);
aBoundedNewFace = myNewFaceBoundedFace(aNewFace);
if (aFace.Orientation() == TopAbs_REVERSED)
aBoundedNewFace.Reverse();
}
else
aBoundedNewFace = aFace;
BB.Add(aShell, aBoundedNewFace);
}
BB.Add(aSolid, aShell);
ShapeFix_Shape Fixer(aSolid);
Fixer.Perform();
myShape = Fixer.Shape();
//myShape = aSolid;
Done();
}
void BRepOffsetAPI_PatchFaces::UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
TopoDS_Edge& thePrevNewEdge,
const TopoDS_Edge& theCurEdge,
TopoDS_Edge& theCurNewEdge,
TopoDS_Vertex& theCurVertex)
{
BRep_Builder BB;
TopoDS_Vertex CurNewVertex;
if (myVertexNewVertex.IsBound(theCurVertex))
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(theCurVertex));
else
{
Standard_Boolean IsConstVertex = (!(myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
!(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge)));
if (IsConstVertex)
CurNewVertex = theCurVertex;
}
Standard_Boolean IsSeamPrev = (myOrientedEdgeNewEdge.IsBound(thePrevEdge));
Standard_Boolean IsSeamCur = (myOrientedEdgeNewEdge.IsBound(theCurEdge));
if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) &&
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //two new edges: intersect
{
Standard_Real ParamOnPrev, ParamOnCur, TolProj;
gp_Pnt PntOnPrev, PntOnCur;
ProjectVertexOnNewEdge(theCurVertex, thePrevEdge, thePrevNewEdge,
ParamOnPrev, PntOnPrev, TolProj);
ProjectVertexOnNewEdge(theCurVertex, theCurEdge, theCurNewEdge,
ParamOnCur, PntOnCur, TolProj);
Standard_Real TolReached;
gp_Pnt PntVtx = (CurNewVertex.IsNull())?
BRep_Tool::Pnt(theCurVertex) : BRep_Tool::Pnt(CurNewVertex);
TolReached = PntOnPrev.Distance(PntOnCur);
Standard_Real DistVtoPrev = PntVtx.Distance(PntOnPrev);
Standard_Real DistVtoCur = PntVtx.Distance(PntOnCur);
TolReached = Max(TolReached, DistVtoPrev);
TolReached = Max(TolReached, DistVtoCur);
BRepExtrema_ExtCC ExtrEE(thePrevNewEdge, theCurNewEdge);
if (!ExtrEE.IsDone() || ExtrEE.NbExt() == 0)
{
cout<<endl<<"Extrema EE is not done"<<endl;
}
else
{
Standard_Integer imin = 1;
for (Standard_Integer iext = 2; iext <= ExtrEE.NbExt(); iext++)
if (ExtrEE.SquareDistance(iext) < ExtrEE.SquareDistance(imin))
imin = iext;
Standard_Real TolEE = sqrt(ExtrEE.SquareDistance(imin));
gp_Pnt PntOnE1 = ExtrEE.PointOnE1(imin);
gp_Pnt PntOnE2 = ExtrEE.PointOnE2(imin);
Standard_Real DistVtoE1 = PntVtx.Distance(PntOnE1);
Standard_Real DistVtoE2 = PntVtx.Distance(PntOnE2);
TolEE = Max(TolEE, DistVtoE1);
TolEE = Max(TolEE, DistVtoE2);
if (TolEE < TolReached)
{
TolReached = TolEE;
PntOnPrev = PntOnE1;
PntOnCur = PntOnE2;
ParamOnPrev = ExtrEE.ParameterOnE1(imin);
ParamOnCur = ExtrEE.ParameterOnE2(imin);
}
}
if (CurNewVertex.IsNull())
{
gp_Pnt NewPnt((PntOnPrev.XYZ() + PntOnCur.XYZ())/2);
CurNewVertex = BRepLib_MakeVertex(NewPnt);
myVertexNewVertex.Bind(theCurVertex, CurNewVertex);
}
BB.UpdateVertex(CurNewVertex, TolReached);
if (!EdgeContains(thePrevNewEdge, CurNewVertex))
{
if (IsSeamCur)
ParamOnPrev = RealLast();
PutVertexToEdge(CurNewVertex, theCurVertex, thePrevNewEdge, thePrevEdge, ParamOnPrev);
}
if (!EdgeContains(theCurNewEdge, CurNewVertex))
{
if (IsSeamPrev)
ParamOnCur = RealLast();
PutVertexToEdge(CurNewVertex, theCurVertex, theCurNewEdge, theCurEdge, ParamOnCur);
}
} //two new edges: intersect
else if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //one constant edge: project point onto curve
{
TopoDS_Edge ConstantEdge, ModifiedEdge, NewEdge;
Standard_Boolean IsAdjacentSeam;
if (myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge))
{
ConstantEdge = theCurEdge;
ModifiedEdge = thePrevEdge;
NewEdge = thePrevNewEdge;
IsAdjacentSeam = IsSeamCur;
}
else
{
ConstantEdge = thePrevEdge;
ModifiedEdge = theCurEdge;
NewEdge = theCurNewEdge;
IsAdjacentSeam = IsSeamPrev;
}
Standard_Real ParamOnNewEdge, TolReached;
gp_Pnt PntOnNewEdge;
ProjectVertexOnNewEdge(theCurVertex, ModifiedEdge, NewEdge,
ParamOnNewEdge, PntOnNewEdge, TolReached);
BB.UpdateVertex(theCurVertex, TolReached);
if (!EdgeContains(NewEdge, theCurVertex))
PutVertexToEdge(theCurVertex, theCurVertex, NewEdge, ModifiedEdge, ParamOnNewEdge);
} //else (one constant edge: project point onto curve)
else //two constant edges
{
//nothing ?
}
}
void BRepOffsetAPI_PatchFaces::PutVertexToEdge(const TopoDS_Vertex& theVertex,
const TopoDS_Vertex& theProVertex,
TopoDS_Edge& theEdge,
const TopoDS_Edge& theProEdge,
const Standard_Real theParamOnEdge)
{
BRep_Builder BB;
TopAbs_Orientation anOr = OrientationInEdge(theProVertex, theProEdge);
if (myEdgeNewEdge.IsBound(theProEdge) &&
myEdgeNewEdge(theProEdge).Orientation() == TopAbs_REVERSED)
anOr = TopAbs::Reverse(anOr);
TopoDS_Shape F_Edge = theEdge.Oriented(TopAbs_FORWARD);
F_Edge.Free(Standard_True);
BB.Add(F_Edge, theVertex.Oriented(anOr));
if (!Precision::IsInfinite(theParamOnEdge))
{
Standard_Real fpar, lpar;
BRep_Tool::Range(theEdge, fpar, lpar);
if (anOr == TopAbs_FORWARD)
BB.Range(theEdge, theParamOnEdge, lpar);
else
BB.Range(theEdge, fpar, theParamOnEdge);
}
}

View File

@@ -1,99 +0,0 @@
// Created on: 2012-08-06
// Created by: jgv@ROLEX
// Copyright (c) 2012-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepOffsetAPI_PatchFaces_HeaderFile
#define _BRepOffsetAPI_PatchFaces_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_DataMapOfOrientedShapeShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
class TopoDS_Shape;
//! Describes functions to replace some faces in a shape
//! by patches
class BRepOffsetAPI_PatchFaces : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! General constructor.
Standard_EXPORT BRepOffsetAPI_PatchFaces(const TopoDS_Shape& aShape);
//! Adds the patch face for the face in the shape.
Standard_EXPORT void AddPatchFace (const TopoDS_Face& theFace, const TopoDS_Face& thePatchFace);
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
protected:
private:
Standard_EXPORT void UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
TopoDS_Edge& thePrevNewEdge,
const TopoDS_Edge& theCurEdge,
TopoDS_Edge& theCurNewEdge,
TopoDS_Vertex& theCurVertex);
Standard_EXPORT void PutVertexToEdge(const TopoDS_Vertex& theVertex,
const TopoDS_Vertex& theProVertex,
TopoDS_Edge& theEdge,
const TopoDS_Edge& theProEdge,
const Standard_Real theParamOnEdge);
TopoDS_Shape myInitialShape;
TopTools_IndexedDataMapOfShapeShape myFacePatchFace;
TopTools_IndexedDataMapOfShapeShape myFaceNewFace;
TopTools_DataMapOfShapeShape myNewFaceBoundedFace;
TopTools_DataMapOfShapeShape myEdgeNewEdge;
TopTools_DataMapOfOrientedShapeShape myOrientedEdgeNewEdge;
TopTools_DataMapOfShapeShape myVertexNewVertex;
TopTools_MapOfShape myTangentEdges;
TopTools_IndexedDataMapOfShapeListOfShape myEFmap;
};
#endif // _BRepOffsetAPI_PatchFaces_HeaderFile

View File

@@ -62,8 +62,6 @@
#include <DBRep_DrawableShape.hxx>
#include <BRepTest.hxx>
#include <BRepOffsetAPI_PatchFaces.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <ChFi3d_FilletShape.hxx>
@@ -2288,36 +2286,6 @@ static Standard_Integer ComputeSimpleOffset(Draw_Interpretor& theCommands,
return 0;
}
//=======================================================================
//function : patchfaces
//purpose :
//=======================================================================
static Standard_Integer patchfaces(Draw_Interpretor& /*di*/,
Standard_Integer n, const char** a)
{
if (n < 5) return 1;
TopoDS_Shape aShape = DBRep::Get(a[2]);
if (aShape.IsNull()) return 1;
TopoDS_Shape aLocalFace = DBRep::Get(a[3], TopAbs_FACE);
if (aLocalFace.IsNull()) return 1;
TopoDS_Face aFace = TopoDS::Face(aLocalFace);
TopoDS_Shape aLocalNewFace = DBRep::Get(a[4], TopAbs_FACE);
if (aLocalNewFace.IsNull()) return 1;
TopoDS_Face aNewFace = TopoDS::Face(aLocalNewFace);
BRepOffsetAPI_PatchFaces Builder(aShape);
Builder.AddPatchFace(aFace, aNewFace);
Builder.Build();
TopoDS_Shape Result = Builder.Shape();
DBRep::Set(a[1], Result);
return 0;
}
//=======================================================================
//function : FeatureCommands
//purpose :
@@ -2466,7 +2434,4 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands)
theCommands.Add("offsetshapesimple",
"offsetshapesimple result shape offsetvalue [solid]",
__FILE__, ComputeSimpleOffset);
theCommands.Add("patchfaces", "patchfaces res shape face newface",
__FILE__,patchfaces,g);
}

View File

@@ -1074,7 +1074,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
}
// allocate the arrays
TColStd_Array1OfInteger Free (1, Max (1, 2 * nFree));
TColStd_Array1OfInteger Free(1,2*nFree);
// array is replaced on map because it is impossible
// to calculate number of internal edges in advance

View File

@@ -13,11 +13,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// ---------------------
// ---------------------
// Version: 0.0
// Version Date Purpose
// 0.0 Feb 10 1997 Creation
// Version: 0.0
//Version Date Purpose
// 0.0 Feb 10 1997 Creation
#include <DDF.hxx>
@@ -64,11 +64,11 @@
//=======================================================================
static Standard_Integer DDF_Children (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n < 2) return 1;
Handle(TDF_Data) DF;
TCollection_AsciiString entry;
@@ -97,11 +97,11 @@ static Standard_Integer DDF_Children (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n != 3) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
@@ -124,11 +124,11 @@ static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
Standard_Integer n,
const char** a)
Standard_Integer n,
const char** a)
{
if (n != 3) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
@@ -137,35 +137,11 @@ static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
TDF_Tool::Label(DF,a[2],label);
if (label.IsNull()) return 1;
label.ForgetAllAttributes();
//POP pour NT
//POP pour NT
return 0;
}
//=======================================================================
//function : ForgetAttribute
//purpose : "ForgetAtt dfname Label guid"
//=======================================================================
static Standard_Integer DDF_ForgetAttribute(Draw_Interpretor& di,
Standard_Integer n,
const char** a)
{
if (n != 4) return 1;
Handle(TDF_Data) DF;
if (!DDF::GetDF (a[1], DF)) return 1;
TDF_Label aLabel;
TDF_Tool::Label(DF,a[2],aLabel);
if (aLabel.IsNull()) return 1;
if (!Standard_GUID::CheckGUIDFormat(a[3]))
{
di<<"DDF: The format of GUID is invalid\n";
return 1;
}
Standard_GUID guid(a[3]);
aLabel.ForgetAttribute(guid);
return 0;
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// save/restore & Store/Retrieve commands
@@ -233,8 +209,8 @@ void ErrorMessage (const Storage_Error n)
//=======================================================================
static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
if (nb == 3) {
Handle(TDF_Data) DF;
@@ -256,8 +232,8 @@ static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
if (nb == 3) {
Handle(TDF_Data) DF;
@@ -278,8 +254,8 @@ static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
//=======================================================================
static Standard_Integer DDF_NewChild (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
Standard_Integer nb,
const char** arg)
{
Handle(TDF_Data) DF;
if (nb>=2){
@@ -338,38 +314,35 @@ void DDF::BasicCommands (Draw_Interpretor& theCommands)
const char* g = "DF basic commands";
// Label :
// Label :
theCommands.Add ("SetTagger",
"SetTagger (DF, entry)",
__FILE__, DDF_SetTagger, g);
__FILE__, DDF_SetTagger, g);
theCommands.Add ("NewTag",
"NewTag (DF, tagger)",
__FILE__, DDF_NewTag, g);
__FILE__, DDF_NewTag, g);
theCommands.Add ("NewChild",
"NewChild (DF, [tagger])",
__FILE__, DDF_NewChild, g);
__FILE__, DDF_NewChild, g);
theCommands.Add ("Children",
" Returns the list of label children: Children DF label",
__FILE__, DDF_Children, g);
" Returns the list of label children: Children DF label",
__FILE__, DDF_Children, g);
theCommands.Add ("Attributes",
" Returns the list of label attributes: Attributes DF label",
__FILE__, DDF_Attributes, g);
" Returns the list of label attributes: Attributes DF label",
__FILE__, DDF_Attributes, g);
theCommands.Add ("ForgetAll",
"Forgets all attributes from the label: ForgetAll DF Label",
__FILE__, DDF_ForgetAll, g);
theCommands.Add ("ForgetAtt",
"Forgets the specified by guid attribute from the label: ForgetAtt DF Label guid",
__FILE__, DDF_ForgetAttribute, g);
"Forgets all attributes from the label: ForgetAll DF Label",
__FILE__, DDF_ForgetAll, g);
theCommands.Add ("Label",
"Label DF entry",
__FILE__, DDF_Label, g);
"Label DF entry",
__FILE__, DDF_Label, g);
}

View File

@@ -72,90 +72,12 @@ GeomEvaluator_OffsetSurface::GeomEvaluator_OffsetSurface(
{
}
// If point is on parametric boundary, and calculation of normal fails,
// try shifting it towards the inside in the hope that derivatives
// are better defined there.
//
// NB: temporarily this is made as static function and not class method,
// hence code duplications
static Standard_Boolean shiftPoint (Standard_Real& theU, Standard_Real& theV,
const Handle(Geom_Surface)& theSurf,
const Handle(GeomAdaptor_HSurface)& theAdaptor)
{
// Get parametric bounds and closure status
Standard_Real aUMin, aUMax, aVMin, aVMax;
Standard_Boolean isUPeriodic, isVPeriodic;
if (! theSurf.IsNull())
{
theSurf->Bounds (aUMin, aUMax, aVMin, aVMax);
isUPeriodic = theSurf->IsUPeriodic();
isVPeriodic = theSurf->IsVPeriodic();
}
else
{
aUMin = theAdaptor->FirstUParameter();
aUMax = theAdaptor->LastUParameter();
aVMin = theAdaptor->FirstVParameter();
aVMax = theAdaptor->LastVParameter();
isUPeriodic = theAdaptor->IsUPeriodic();
isVPeriodic = theAdaptor->IsVPeriodic();
}
Standard_Boolean isShifted = Standard_False;
// shift by U
if (! isUPeriodic && aUMax - aUMin > 2 * Precision::PConfusion())
{
if (Abs (theU - aUMin) < Precision::PConfusion())
{
theU += Precision::PConfusion();
isShifted = Standard_True;
}
else if (Abs (theU - aUMax) < Precision::PConfusion())
{
theU -= Precision::PConfusion();
isShifted = Standard_True;
}
}
// shift by V
if (! isVPeriodic && aVMax - aVMin > 2 * Precision::PConfusion())
{
if (Abs (theV - aVMin) < Precision::PConfusion())
{
theV += Precision::PConfusion();
isShifted = Standard_True;
}
else if (Abs (theV - aVMax) < Precision::PConfusion())
{
theV -= Precision::PConfusion();
isShifted = Standard_True;
}
}
return isShifted;
}
void GeomEvaluator_OffsetSurface::D0(
const Standard_Real theU, const Standard_Real theV, gp_Pnt& theValue) const
{
gp_Vec aD1U, aD1V;
BaseD1(theU, theV, theValue, aD1U, aD1V);
try
{
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD1(aU, aV, theValue, aD1U, aD1V);
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
CalculateD0(theU, theV, theValue, aD1U, aD1V);
}
void GeomEvaluator_OffsetSurface::D1(
@@ -164,21 +86,7 @@ void GeomEvaluator_OffsetSurface::D1(
{
gp_Vec aD2U, aD2V, aD2UV;
BaseD2(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
try
{
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD2 (aU, aV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
CalculateD1(theU, theV, theValue, theD1U, theD1V, aD2U, aD2V, aD2UV);
}
void GeomEvaluator_OffsetSurface::D2(
@@ -189,24 +97,8 @@ void GeomEvaluator_OffsetSurface::D2(
gp_Vec aD3U, aD3V, aD3UUV, aD3UVV;
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
try
{
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
CalculateD2(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, aD3U, aD3V, aD3UUV, aD3UVV);
}
void GeomEvaluator_OffsetSurface::D3(
@@ -217,24 +109,8 @@ void GeomEvaluator_OffsetSurface::D3(
{
BaseD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
try
{
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD3(aU, aV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
CalculateD3(theU, theV, theValue, theD1U, theD1V,
theD2U, theD2V, theD2UV, theD3U, theD3V, theD3UUV, theD3UVV);
}
gp_Vec GeomEvaluator_OffsetSurface::DN(
@@ -249,21 +125,7 @@ gp_Vec GeomEvaluator_OffsetSurface::DN(
gp_Pnt aP;
gp_Vec aD1U, aD1V;
BaseD1(theU, theV, aP, aD1U, aD1V);
try
{
return CalculateDN(theU, theV, theDerU, theDerV, aD1U, aD1V);
}
catch (Geom_UndefinedValue&)
{
// if failed at parametric boundary, try taking derivative at shifted point
Standard_Real aU = theU, aV = theV;
if (! shiftPoint (aU, aV, myBaseSurf, myBaseAdaptor))
{
throw;
}
BaseD1 (aU, aV, aP, aD1U, aD1V);
return CalculateDN (theU, theV, theDerU, theDerV, aD1U, aD1V);
}
return CalculateDN(theU, theV, theDerU, theDerV, aD1U, aD1V);
}

View File

@@ -6,6 +6,7 @@ Graphic3d_ArrayOfPolylines.cxx
Graphic3d_ArrayOfPolylines.hxx
Graphic3d_ArrayOfPrimitives.cxx
Graphic3d_ArrayOfPrimitives.hxx
Graphic3d_ArrayOfPrimitives.lxx
Graphic3d_ArrayOfQuadrangles.cxx
Graphic3d_ArrayOfQuadrangles.hxx
Graphic3d_ArrayOfQuadrangleStrips.cxx

View File

@@ -14,18 +14,22 @@
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_Group.hxx>
#include <NCollection_AlignedAllocator.hxx>
#include <OSD_Environment.hxx>
#include <Quantity_Color.hxx>
#include <Standard.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <stdio.h>
#include <stdlib.h>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives,Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPrimitives, Standard_Transient)
// =======================================================================
// function : Graphic3d_ArrayOfPrimitives
// purpose :
// =======================================================================
Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOfPrimitiveArray theType,
const Standard_Integer theMaxVertexs,
const Standard_Integer theMaxBounds,
@@ -148,11 +152,7 @@ Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOf
myMaxEdges = theMaxEdges;
}
// =======================================================================
// function : ~Graphic3d_ArrayOfPrimitives
// purpose :
// =======================================================================
Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
void Graphic3d_ArrayOfPrimitives::Destroy()
{
myVNor = 0;
myVTex = 0;
@@ -162,10 +162,98 @@ Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
myBounds .Nullify();
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX,
const Standard_ShortReal theY,
const Standard_ShortReal theZ)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Quantity_Color& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor.Red(), theColor.Green(), theColor.Blue());
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Standard_Integer theColor32)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor32);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexNormal (anIndex, theNX, theNY, theNZ);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const Quantity_Color& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex, theNormal);
SetVertexColor (anIndex, theColor.Red(), theColor.Green(), theColor.Blue());
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const Standard_Integer theColor32)
{
const Standard_Integer anIndex = AddVertex (theVertex, theNormal);
SetVertexColor (anIndex, theColor32);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theTX, const Standard_ShortReal theTY)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexTexel (anIndex, theTX, theTY);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ,
const Standard_ShortReal theNX, const Standard_ShortReal theNY, const Standard_ShortReal theNZ,
const Standard_ShortReal theTX, const Standard_ShortReal theTY)
{
if (myAttribs.IsNull())
{
return 0;
}
const Standard_Integer anIndex = myAttribs->NbElements + 1;
SetVertice (anIndex, theX, theY, theZ);
SetVertexNormal (anIndex, theNX, theNY, theNZ);
SetVertexTexel (anIndex, theTX, theTY);
return anIndex;
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber)
{
if (myBounds.IsNull())
@@ -183,10 +271,12 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer t
return anIndex;
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber,
const Quantity_Color& theColor)
{
return AddBound (theEdgeNumber, theColor.Red(), theColor.Green(), theColor.Blue());
}
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer theEdgeNumber,
const Standard_Real theR,
const Standard_Real theG,
@@ -208,10 +298,6 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound (const Standard_Integer t
return anIndex;
}
// =======================================================================
// function : AddEdge
// purpose :
// =======================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge (const Standard_Integer theVertexIndex)
{
if (myIndices.IsNull())
@@ -237,10 +323,59 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge (const Standard_Integer th
return anIndex;
}
// =======================================================================
// function : StringType
// purpose :
// =======================================================================
void Graphic3d_ArrayOfPrimitives::SetVertice (const Standard_Integer theIndex,
const gp_Pnt& theVertex)
{
SetVertice (theIndex,
Standard_ShortReal (theVertex.X()),
Standard_ShortReal (theVertex.Y()),
Standard_ShortReal (theVertex.Z()));
}
void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Quantity_Color& theColor)
{
SetVertexColor (theIndex, theColor.Red(), theColor.Green(), theColor.Blue());
}
void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Standard_Integer theColor)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
{
*reinterpret_cast<Standard_Integer* >(myAttribs->changeValue (theIndex - 1) + size_t(myVCol)) = theColor;
}
}
void Graphic3d_ArrayOfPrimitives::SetVertexNormal (const Standard_Integer theIndex,
const gp_Dir& theNormal)
{
SetVertexNormal (theIndex, theNormal.X(), theNormal.Y(), theNormal.Z());
}
void Graphic3d_ArrayOfPrimitives::SetVertexTexel (const Standard_Integer theIndex,
const gp_Pnt2d& theTexel)
{
SetVertexTexel (theIndex, theTexel.X(), theTexel.Y());
}
void Graphic3d_ArrayOfPrimitives::SetBoundColor (const Standard_Integer theIndex,
const Quantity_Color& theColor)
{
SetBoundColor (theIndex, theColor.Red(), theColor.Green(), theColor.Blue());
}
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
{
switch (myType)
@@ -259,10 +394,41 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
return "UndefinedArray";
}
// =======================================================================
// function : ItemNumber
// purpose :
// =======================================================================
gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice (const Standard_Integer theRank) const
{
Standard_Real anXYZ[3];
Vertice (theRank, anXYZ[0], anXYZ[1], anXYZ[2]);
return gp_Pnt (anXYZ[0], anXYZ[1], anXYZ[2]);
}
Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theRank) const
{
Standard_Real anRGB[3];
VertexColor (theRank, anRGB[0], anRGB[1], anRGB[2]);
return Quantity_Color (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
}
gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal (const Standard_Integer theRank) const
{
Standard_Real anXYZ[3];
VertexNormal (theRank, anXYZ[0], anXYZ[1], anXYZ[2]);
return gp_Dir (anXYZ[0], anXYZ[1], anXYZ[2]);
}
gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel (const Standard_Integer theRank) const
{
Standard_Real anXY[2];
VertexTexel (theRank, anXY[0], anXY[1]);
return gp_Pnt2d (anXY[0], anXY[1]);
}
Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor (const Standard_Integer theRank) const
{
Standard_Real anRGB[3] = {0.0, 0.0, 0.0};
BoundColor (theRank, anRGB[0], anRGB[1], anRGB[2]);
return Quantity_Color (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
}
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
{
if (myAttribs.IsNull())
@@ -298,10 +464,66 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
return -1;
}
// =======================================================================
// function : IsValid
// purpose :
// =======================================================================
void Graphic3d_ArrayOfPrimitives::ComputeVNormals (const Standard_Integer theFrom,
const Standard_Integer theTo)
{
Standard_Integer aNext = theFrom + 1;
Standard_Integer aLast = theTo + 1;
gp_Pnt aTri[3];
if (myMaxEdges > 0)
{
aTri[0] = Vertice (Edge (aNext++));
aTri[1] = Vertice (Edge (aNext++));
}
else
{
aTri[0] = Vertice (aNext++);
aTri[1] = Vertice (aNext++);
}
gp_Vec vn;
while (aNext <= aLast)
{
if (myMaxEdges > 0)
{
aTri[2] = Vertice (Edge (aNext));
}
else
{
aTri[2] = Vertice (aNext);
}
gp_Vec v21 (aTri[1], aTri[0]);
gp_Vec v31 (aTri[2], aTri[0]);
vn = v21 ^ v31;
if (vn.SquareMagnitude() > 0.0)
{
break;
}
aNext++;
}
if (aNext > aLast)
{
return;
}
vn.Normalize();
if (myMaxEdges > 0)
{
for (int i = theFrom + 1; i <= theTo + 1; i++)
{
SetVertexNormal (Edge (i), vn);
}
}
else
{
for (int i = theFrom + 1; i <= theTo + 1; i++)
{
SetVertexNormal (i, vn);
}
}
}
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
{
if (myAttribs.IsNull())

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,427 @@
// Created on: 2000-06-16
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Standard_OutOfRange.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
inline const Handle(Graphic3d_IndexBuffer)& Graphic3d_ArrayOfPrimitives::Indices() const
{
return myIndices;
}
inline const Handle(Graphic3d_Buffer)& Graphic3d_ArrayOfPrimitives::Attributes() const
{
return myAttribs;
}
inline const Handle(Graphic3d_BoundBuffer)& Graphic3d_ArrayOfPrimitives::Bounds() const
{
return myBounds;
}
inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const
{
return myType;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const
{
return myVNor != 0;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const
{
return myVCol != 0;
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const
{
return myVTex != 0;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const
{
return !myAttribs.IsNull() ? myAttribs->NbElements : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Graphic3d_Vec3& theVertex)
{
return AddVertex (theVertex.x(), theVertex.y(), theVertex.z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const Graphic3d_Vec4ub& theColor)
{
const Standard_Integer anIndex = AddVertex (theVertex);
SetVertexColor (anIndex, theColor);
return anIndex;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ)
{
return AddVertex (RealToShortReal (theX),
RealToShortReal (theY),
RealToShortReal (theZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theNormal.X(), theNormal.Y(), theNormal.Z());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Pnt2d& theTexel)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theTexel.X(), theTexel.Y());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theTX, const Standard_Real theTY)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const gp_Pnt& theVertex,
const gp_Dir& theNormal,
const gp_Pnt2d& theTexel)
{
return AddVertex (theVertex.X(), theVertex.Y(), theVertex.Z(),
theNormal.X(), theNormal.Y(), theNormal.Z(),
theTexel.X(), theTexel.Y());
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
const Standard_Real theNX, const Standard_Real theNY, const Standard_Real theNZ,
const Standard_Real theTX, const Standard_Real theTY)
{
return AddVertex (RealToShortReal (theX), RealToShortReal (theY), RealToShortReal (theZ),
Standard_ShortReal (theNX), Standard_ShortReal (theNY), Standard_ShortReal (theNZ),
Standard_ShortReal (theTX), Standard_ShortReal (theTY));
}
inline void Graphic3d_ArrayOfPrimitives::SetVertice (const Standard_Integer theIndex,
const Standard_ShortReal theX,
const Standard_ShortReal theY,
const Standard_ShortReal theZ)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
Graphic3d_Vec3& aVec = myAttribs->ChangeValue<Graphic3d_Vec3> (theIndex - 1);
aVec.x() = theX;
aVec.y() = theY;
aVec.z() = theZ;
if (myAttribs->NbElements < theIndex)
{
myAttribs->NbElements = theIndex;
}
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Standard_Real theR,
const Standard_Real theG,
const Standard_Real theB)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
{
Graphic3d_Vec4ub aColor (Standard_Byte(theR * 255.0),
Standard_Byte(theG * 255.0),
Standard_Byte(theB * 255.0), 255);
SetVertexColor (theIndex, *reinterpret_cast<Standard_Integer*>(&aColor));
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor (const Standard_Integer theIndex,
const Graphic3d_Vec4ub& theColor)
{
SetVertexColor (theIndex, *reinterpret_cast<const Standard_Integer*> (&theColor));
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexNormal (const Standard_Integer theIndex,
const Standard_Real theNX,
const Standard_Real theNY,
const Standard_Real theNZ)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
{
Graphic3d_Vec3& aVec = *reinterpret_cast<Graphic3d_Vec3* >(myAttribs->changeValue (theIndex - 1) + size_t(myVNor));
aVec.x() = Standard_ShortReal (theNX);
aVec.y() = Standard_ShortReal (theNY);
aVec.z() = Standard_ShortReal (theNZ);
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel (const Standard_Integer theIndex,
const Standard_Real theTX,
const Standard_Real theTY)
{
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
{
Graphic3d_Vec2& aVec = *reinterpret_cast<Graphic3d_Vec2* >(myAttribs->changeValue (theIndex - 1) + size_t(myVTex));
aVec.x() = Standard_ShortReal (theTX);
aVec.y() = Standard_ShortReal (theTY);
}
myAttribs->NbElements = Max (theIndex, myAttribs->NbElements);
}
inline void Graphic3d_ArrayOfPrimitives::SetBoundColor (const Standard_Integer theIndex,
const Standard_Real theR,
const Standard_Real theG,
const Standard_Real theB)
{
if (myBounds.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myMaxBounds)
{
throw Standard_OutOfRange("BAD BOUND index");
}
Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
aVec.r() = Standard_ShortReal (theR);
aVec.g() = Standard_ShortReal (theG);
aVec.b() = Standard_ShortReal (theB);
aVec.a() = 1.0f;
myBounds->NbBounds = Max (theIndex, myBounds->NbBounds);
}
inline void Graphic3d_ArrayOfPrimitives::Vertice (const Standard_Integer theIndex,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ) const
{
theX = theY = theZ = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
const Graphic3d_Vec3& aVec = myAttribs->Value<Graphic3d_Vec3> (theIndex - 1);
theX = Standard_Real(aVec.x());
theY = Standard_Real(aVec.y());
theZ = Standard_Real(aVec.z());
}
inline void Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theIndex,
Standard_Real& theR,
Standard_Real& theG,
Standard_Real& theB) const
{
theR = theG = theB = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
Standard_Integer aColorInt = 0;
VertexColor (theIndex, aColorInt);
const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(&aColorInt);
theR = Standard_Real(aColor.r()) / 255.0;
theG = Standard_Real(aColor.g()) / 255.0;
theB = Standard_Real(aColor.b()) / 255.0;
}
inline void Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer theIndex,
Standard_Integer& theColor) const
{
if (myVCol != 0)
{
theColor = *reinterpret_cast<const Standard_Integer* >(myAttribs->value (theIndex - 1) + size_t(myVCol));
}
}
inline void Graphic3d_ArrayOfPrimitives::VertexNormal (const Standard_Integer theIndex,
Standard_Real& theNX,
Standard_Real& theNY,
Standard_Real& theNZ) const
{
theNX = theNY = theNZ = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
{
const Graphic3d_Vec3& aVec = *reinterpret_cast<const Graphic3d_Vec3* >(myAttribs->value (theIndex - 1) + size_t(myVNor));
theNX = Standard_Real(aVec.x());
theNY = Standard_Real(aVec.y());
theNZ = Standard_Real(aVec.z());
}
}
inline void Graphic3d_ArrayOfPrimitives::VertexTexel (const Standard_Integer theIndex,
Standard_Real& theTX,
Standard_Real& theTY) const
{
theTX = theTY = 0.0;
if (myAttribs.IsNull())
{
return;
}
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
{
const Graphic3d_Vec2& aVec = *reinterpret_cast<const Graphic3d_Vec2* >(myAttribs->value (theIndex - 1) + size_t(myVTex));
theTX = Standard_Real(aVec.x());
theTY = Standard_Real(aVec.y());
}
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const
{
return !myIndices.IsNull() ? myIndices->NbElements : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge (const Standard_Integer theIndex) const
{
if (myIndices.IsNull()
|| theIndex <= 0
|| theIndex > myIndices->NbElements)
{
throw Standard_OutOfRange("BAD EDGE index");
}
return Standard_Integer(myIndices->Index (theIndex - 1) + 1);
}
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const
{
return !myBounds.IsNull() && myBounds->Colors != NULL;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const
{
return !myBounds.IsNull() ? myBounds->NbBounds : -1;
}
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound (const Standard_Integer theIndex) const
{
if (myBounds.IsNull()
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
throw Standard_OutOfRange("BAD BOUND index");
}
return myBounds->Bounds[theIndex - 1];
}
inline void Graphic3d_ArrayOfPrimitives::BoundColor (const Standard_Integer theIndex,
Standard_Real& theR,
Standard_Real& theG,
Standard_Real& theB) const
{
if (myBounds.IsNull()
|| myBounds->Colors == NULL
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
throw Standard_OutOfRange(" BAD BOUND index");
}
const Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
theR = Standard_Real(aVec.r());
theG = Standard_Real(aVec.g());
theB = Standard_Real(aVec.b());
}

View File

@@ -1371,17 +1371,18 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC,
case GeomAbs_OffsetCurve : {
const Handle(Geom_OffsetCurve)& anOffsetCurve = Handle(Geom_OffsetCurve)::DownCast(aCurve);
const Handle(Geom_Curve)& aBasisCurve = anOffsetCurve->BasisCurve();
GeomAdaptor_Curve aGBasisCurve(aBasisCurve);
const GeomAbs_CurveType aBCType = aGBasisCurve.GetType();
const GeomAbs_CurveType aBCType = GeomAdaptor_Curve(aBasisCurve).GetType();
if (aBCType == GeomAbs_Line) {
break;
}
else if (aBCType == GeomAbs_Circle) {
aResCoeff = 1. / (2 * (anOffsetCurve->Offset() + aGBasisCurve.Circle().Radius()));
aResCoeff = 1. / (2 * (anOffsetCurve->Offset() +
Handle(Geom_Circle)::DownCast (aBasisCurve)->Circ().Radius()));
break;
}
else if (aBCType == GeomAbs_Ellipse) {
aResCoeff = 1. / (anOffsetCurve->Offset() + aGBasisCurve.Ellipse().MajorRadius());
aResCoeff = 1. / (anOffsetCurve->Offset() +
Handle(Geom_Ellipse)::DownCast (aBasisCurve)->MajorRadius());
break;
}
}

View File

@@ -212,18 +212,7 @@ public:
myDeletable (Standard_False)
{
Standard_RangeError_Raise_if (theUpper < theLower, "NCollection_Array1::Create");
#if (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
// gcc emits -Warray-bounds warning when NCollection_Array1 is initialized
// from local array with lower index 1 (so that (&theBegin - 1) points out of array bounds).
// NCollection_Array1 initializes myData with a shift to avoid this shift within per-element access.
// It is undesired changing this logic, and -Warray-bounds is not useful here.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
myData = (TheItemType *) &theBegin - theLower;
#if (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#pragma GCC diagnostic pop
#endif
myData = (TheItemType *) &theBegin - theLower;
}
//! Initialise the items with theValue

View File

@@ -32,7 +32,7 @@ namespace
CLocalePtr()
#ifdef HAVE_XLOCALE_H
: myLocale (newlocale (LC_ALL_MASK, "C", NULL))
#elif defined(_MSC_VER)
#elif defined(_WIN32) && !defined(__MINGW32__)
: myLocale (_create_locale (LC_ALL, "C"))
#else
: myLocale (NULL)
@@ -43,7 +43,7 @@ namespace
{
#ifdef HAVE_XLOCALE_H
freelocale (myLocale);
#elif defined(_MSC_VER)
#elif defined(_WIN32) && !defined(__MINGW32__)
_free_locale (myLocale);
#endif
}

View File

@@ -35,8 +35,7 @@
#endif
#endif // ifndef HAVE_LOCALE_H
#if defined(HAVE_XLOCALE_H) && !(defined(__GLIBC__) && (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 24))
// xlocale.h is actually a non-standard header file; glibc 2.26 has removed it altogether (all definition comes from locale.h)
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif
@@ -66,7 +65,7 @@ public:
#ifdef HAVE_XLOCALE_H
typedef locale_t clocale_t;
#elif defined(_MSC_VER)
#elif defined(_WIN32) && !defined(__MINGW32__)
typedef _locale_t clocale_t;
#else
typedef void* clocale_t;
@@ -79,7 +78,7 @@ public:
private:
void* myPrevLocale; //!< previous locale, platform-dependent pointer!
#ifdef _MSC_VER
#ifdef _WIN32
int myPrevTLocaleState; //!< previous thread-locale state, MSVCRT-specific
#endif

View File

@@ -63,7 +63,7 @@ Standard_Integer HashCodes (const Standard_CString Value,
#ifdef __APPLE__
// There are a lot of *_l functions availalbe on Mac OS X - we use them
#define SAVE_TL()
#elif defined(_MSC_VER)
#elif defined(_WIN32) && !defined(__MINGW32__)
// MSVCRT has equivalents with slightly different syntax
#define SAVE_TL()
#define strtod_l(thePtr, theNextPtr, theLocale) _strtod_l(thePtr, theNextPtr, theLocale)

View File

@@ -72,7 +72,23 @@
#define Standard_ENABLE_DEPRECATION_WARNINGS
#endif
# ifdef _WIN32
//======================================================
// Windows-specific definitions
//======================================================
# if defined(_WIN32) && !defined(HAVE_NO_DLL)
# ifndef Standard_EXPORT
# define Standard_EXPORT __declspec( dllexport )
// For global variables :
# define Standard_EXPORTEXTERN __declspec( dllexport ) extern
# define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
# endif /* Standard_EXPORT */
# ifndef Standard_IMPORT
# define Standard_IMPORT __declspec( dllimport ) extern
# define Standard_IMPORTC extern "C" __declspec( dllimport )
# endif /* Standard_IMPORT */
// We must be careful including windows.h: it is really poisonous stuff!
// The most annoying are #defines of many identifiers that you could use in
@@ -116,30 +132,10 @@
#define NOIME NOIME
#endif
#endif
# if defined(_WIN32) && !defined(HAVE_NO_DLL)
//======================================================
// Windows-specific definitions
//======================================================
# ifndef Standard_EXPORT
# define Standard_EXPORT __declspec( dllexport )
// For global variables :
# define Standard_EXPORTEXTERN __declspec( dllexport ) extern
# define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
# endif /* Standard_EXPORT */
# ifndef Standard_IMPORT
# define Standard_IMPORT __declspec( dllimport ) extern
# define Standard_IMPORTC extern "C" __declspec( dllimport )
# endif /* Standard_IMPORT */
# else /* UNIX */
//======================================================
// UNIX / static library definitions
// UNIX definitions
//======================================================
# ifndef Standard_EXPORT

View File

@@ -42,5 +42,5 @@ TDF_DefaultDeltaOnRemoval::TDF_DefaultDeltaOnRemoval
void TDF_DefaultDeltaOnRemoval::Apply()
{
Label().AddAttribute(Attribute(), Standard_True);
Label().AddAttribute(Attribute());
}

View File

@@ -1,10 +1,10 @@
# Original bug : pro10658
# Date : 24mar98
puts "TODO ALL: Error : The area of result shape is"
restore [locate_data_file CTO900_pro10658a.rle] a
restore [locate_data_file pro10658b.rle] b
bfuse result a b
checkprops result -s 8636.79
checkprops result -s 8231.06
checkview -display result -2d -otherwise { a b } -s -path ${imagedir}/${test_image}.png

View File

@@ -1,19 +0,0 @@
puts "TODO OCC25967 ALL: Error : is WRONG because number of EDGE entities in shape"
puts "========"
puts "OCC25967"
puts "========"
puts ""
########################################################################
# Shape Healing fails to correct a face with missing poles and pcurves
########################################################################
restore [locate_data_file bug25967_face-no-sh-fwd.brep] f
fixshape result f
pcurve result
checknbshapes result -edge 4
v2d
2dfit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,56 +0,0 @@
puts "TODO OCC26052 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "========"
puts "OCC26052"
puts "========"
puts ""
##############################################################################################
# Missing pcurves are computed incorrectly on two connected faces laying on the same surface
##############################################################################################
cylinder c 10
circle c1 0 0 0 10
circle c2 0 0 0 10
circle c3 0 0 10 10
circle c4 0 0 10 10
line l1 10 0 0 0 0 1
line l2 -10 0 0 0 0 1
trim c1 c1 0 pi
trim c2 c2 pi 2*pi
trim c3 c3 0 pi
trim c4 c4 pi 2*pi
trim l1 l1 0 10
trim l2 l2 0 10
vertex v1 10 0 0
vertex v2 -10 0 0
vertex v3 10 0 10
vertex v4 -10 0 10
mkedge ec1 c1 v1 v2
mkedge ec2 c2 v2 v1
mkedge ec3 c3 v3 v4
mkedge ec4 c4 v4 v3
mkedge el1 l1 v1 v3
mkedge el2 l2 v2 v4
shape w1 W
#orientation ec3 R
#orientation el1 R
add ec1 w1
add el2 w1
add ec3 w1
add el1 w1
shape w2 W
#orientation el1 F
#orientation el2 R
#orientation ec4 R
add ec2 w2
add el1 w2
add ec4 w2
add el2 w2
mkface f1 c w1
mkface f2 c w2
shape s Sh
add f1 s
add f2 s
fixshape result s
checkshape result

View File

@@ -1,19 +0,0 @@
puts "TODO OCC25061 ALL: ERROR: OCC25061 is reproduced."
puts "========"
puts "OCC25061"
puts "========"
puts ""
####################################################################################################
# BRepMesh should skip internal wires with self intersections to produce mesh for the shape anyway
####################################################################################################
restore [locate_data_file bug25061_a.brep] a
incmesh a 0.1
set bug_info [tricheck a]
if {[string trim $bug_info] == "face 1 has no triangulation"} {
puts "ERROR: OCC25061 is reproduced. Mesh is not created."
}

View File

@@ -1,33 +0,0 @@
puts "TODO OCC25551 ALL: Error: BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface"
puts "================"
puts "OCC25551"
puts "================"
puts ""
#######################################################################################
# BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface
#######################################################################################
restore [locate_data_file bug25551_m-a-i-B6.brep] res
explode res f
triangles res_2
set ExpectedArea 0.208305
set tol_abs 0.00001
set prop [ sprops res_2]
regexp {Mass\s*:\s*([0-9.e+-]+)} $prop prop_s Area
if { [expr abs($Area - $ExpectedArea)] > $tol_abs } {
puts "OK: BRepMesh not produce internal nodes outside the face interior based on distorted BSpline surface"
} else {
puts "Error: BRepMesh can produce internal nodes outside the face interior based on distorted BSpline surface"
}
smallview
donly res_2
top
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,45 +0,0 @@
puts "TODO OCC25586 ALL: Error : The area of result shape is"
puts "========="
puts "OCC25586"
puts "========="
puts ""
#########################################################
# Poor mesh quality, or failure of meshing for closed extruded surfaces with holes
#########################################################
restore [locate_data_file bug25586_circle_extrusion.brep] result
checkprops result -s 1.
checkview -display result -2d -path ${imagedir}/${test_image}-axo.png
vinit
vdisplay result
vfit
vsetdispmode 1
checkview -screenshot -3d -path ${imagedir}/${test_image}-3d.png
vfront
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-front.png
vback
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-back.png
vleft
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-left.png
vright
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-right.png
vtop
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-top.png
vbottom
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-bottom.png

View File

@@ -1,45 +0,0 @@
puts "TODO OCC25586 ALL: Error : The area of result shape is"
puts "========="
puts "OCC25586"
puts "========="
puts ""
#########################################################
# Poor mesh quality, or failure of meshing for closed extruded surfaces with holes
#########################################################
restore [locate_data_file bug25586_cylindrical_with_circle_hole.brep] result
checkprops result -s 1.
checkview -display result -2d -path ${imagedir}/${test_image}-axo.png
vinit
vdisplay result
vfit
vsetdispmode 1
checkview -screenshot -3d -path ${imagedir}/${test_image}-3d.png
vfront
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-front.png
vback
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-back.png
vleft
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-left.png
vright
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-right.png
vtop
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-top.png
vbottom
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-bottom.png

View File

@@ -1,45 +0,0 @@
puts "TODO OCC25586 ALL: Error : The area of result shape is"
puts "========="
puts "OCC25586"
puts "========="
puts ""
#########################################################
# Poor mesh quality, or failure of meshing for closed extruded surfaces with holes
#########################################################
restore [locate_data_file bug25586_quasi_closed.brep] result
checkprops result -s 1.
checkview -display result -2d -path ${imagedir}/${test_image}-axo.png
vinit
vdisplay result
vfit
vsetdispmode 1
checkview -screenshot -3d -path ${imagedir}/${test_image}-3d.png
vfront
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-front.png
vback
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-back.png
vleft
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-left.png
vright
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-right.png
vtop
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-top.png
vbottom
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-bottom.png

View File

@@ -1,32 +0,0 @@
puts "TODO CR25628 ALL: Error: Number of triangles is equal to 0"
puts "TODO CR25628 ALL: Error: Number of nodes is equal to 0"
puts "TODO CR25628 ALL: Error: BRepMesh fails to mesh face with open wire, considered as correct by checkshape"
puts "========="
puts "CR25628"
puts "========="
puts ""
##############################################################################################
# BRepMesh fails to mesh face with open wire, considered as correct by checkshape
##############################################################################################
pload XDE
stepread [locate_data_file bug25628_twr_hull.stp] a *
renamevar a_1 a
explode a f
checkshape a_36
set Log [incmesh a_36 0.1]
if {[regexp "OpenWire" ${Log}] == 1} {
puts "Error: BRepMesh fails to mesh face with open wire, considered as correct by checkshape"
}
checktrinfo a_1 -tri -nod
smallview
donly a_36
left
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}-2d.png

View File

@@ -1,31 +0,0 @@
puts "TODO CR25738 ALL: Not connected mesh inside face"
puts "TODO CR25738 ALL: Error: BRepMesh fails to produce correct mesh for the face"
puts "========="
puts "CR25738"
puts "========="
puts ""
######################################################
# BRepMesh fails to produce correct mesh for the face
######################################################
restore [locate_data_file bug25738_face1736.brep] a
incmesh a 1 -a 20
front
fit
isos a 0
triangles a
trinfo a
set info [tricheck a]
set pattern "Free_links +(\[0-9\]+) +Cross_face_errors +(\[0-9\]+) +Async_edges +(\[0-9\]+) +Free_nodes +(\[0-9\]+)"
regexp "${pattern}" $info full freelinks crossfaces asyncedges freenodes
if { $freenodes > 0 } {
puts "Error: BRepMesh fails to produce correct mesh for the face"
}
checkview -screenshot -2d -path ${imagedir}/${test_image}-2d.png

View File

@@ -1,34 +0,0 @@
puts "========="
puts "CR25817"
puts "========="
puts ""
#############################
# crescent face is not meshed
#############################
restore [locate_data_file bug25817_mesh-missing-cresent.brep] c
tclean c
set Log [incmesh c 0.1]
if {[regexp "NoError" ${Log}] == 0} {
puts "Error: face is not meshed"
}
tricheck c
smallview
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}-1.png
explode c F
set Log [incmesh c_4 0.1]
if {[regexp "NoError" ${Log}] == 0} {
puts "Error: crescent face is not meshed"
}
clear
donly c_4
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}-2.png

View File

@@ -1,20 +0,0 @@
puts "TODO CR25827 ALL: Faulty shapes in variables faulty_"
puts "========="
puts "CR25827"
puts "========="
puts ""
############################################################################
# BRepMesh does not synchronize parameters of glued vertices on small edges
############################################################################
restore [locate_data_file bug25827_result_valid.brep] r
checkshape r
incmesh r 0.01 -a 10 -relative -parallel
checkshape r
checkview -display r -2d -path ${imagedir}/${test_image}-2d.png
checkview -display r -3d -path ${imagedir}/${test_image}-3d.png

View File

@@ -1,25 +0,0 @@
puts "========="
puts "CR25837"
puts "========="
puts ""
######################################################
# Bad triangulation when IGES loaded in meters
######################################################
pload XDE
param xstep.cascade.unit MM
newmodel
igesbrep [locate_data_file bug25837_S.igs] result *
vinit
vdisplay result
vfit
vsetdispmode 1
set x 200
set y 200
checkcolor $x $y 0 0 0
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -1,27 +0,0 @@
puts "TODO CR25837 ALL: Error : Colors are not equal in default coordinate and in the near coordinates too"
puts "========="
puts "CR25837"
puts "========="
puts ""
######################################################
# Bad triangulation when IGES loaded in meters
######################################################
pload XDE
param xstep.cascade.unit M
newmodel
igesbrep [locate_data_file bug25837_S.igs] result *
vinit
vdisplay result
vfit
vsetdispmode 1
set x 200
set y 200
checkcolor $x $y 0 0 0
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -1,28 +0,0 @@
puts "TODO OCC23838 Windows: OSD_Exception_ACCESS_VIOLATION"
puts "TODO OCC23838 Linux: segmentation violation"
puts "TODO OCC23838 ALL:TEST INCOMPLETE"
puts "============"
puts "OCC23838"
puts "============"
puts ""
#######################################################
# Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
#######################################################
restore [locate_data_file bug23838_profile.brep] prof
restore [locate_data_file bug23838_SpineAndSupport.brep] comp
explode comp
renamevar comp_1 supp
renamevar comp_2 spine
mksweep spine
setsweep -DX supp
addsweep prof
buildsweep result -R
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,22 +0,0 @@
puts "============"
puts "OCC23925"
puts "============"
puts ""
#######################################################################
# BRepFeat_SplitShape produces invalid shape
#######################################################################
restore [locate_data_file bug23925_E.brep] e
restore [locate_data_file bug23925_F.brep] f
splitshape result f f e
set nb_F [ llength [explode result F] ]
if { ${nb_F} == 2 } {
puts "OK: BRepFeat_SplitShape produces good shape"
} else {
puts "Error: BRepFeat_SplitShape produces invalid shape"
}
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,87 +0,0 @@
puts "TODO OCC23942 ALL: is not equal"
puts "========"
puts "OCC23942"
puts "========"
puts ""
#########################################################
# Pipe algorithms unrobust to number rounding
#########################################################
#
### 1
#
interpol c [locate_data_file bug23942_points.txt]
tuyau r_1 c 5
decho off
dlog reset
dlog on
dump r_1
set info_1 [dlog get]
dlog reset
dlog off
decho on
regexp {Degrees :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_1} full X Degrees_1
regexp {NbPoles :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_1} full X NbPoles_1
regexp {NbKnots :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_1} full UKnots_1 VKnots_1
puts "Degrees_1 = ${Degrees_1}"
puts "NbPoles_1 = ${NbPoles_1}"
puts "UKnots_1 = ${UKnots_1}"
puts "VKnots_1 = ${VKnots_1}"
#
### 2
#
save c ${imagedir}/cc
restore ${imagedir}/cc
tuyau r_2 cc 5
decho off
dlog reset
dlog on
dump r_2
set info_2 [dlog get]
dlog reset
dlog off
decho on
regexp {Degrees :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_2} full X Degrees_2
regexp {NbPoles :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_2} full X NbPoles_2
regexp {NbKnots :+([-0-9.+eE]+) +([-0-9.+eE]+)} ${info_2} full UKnots_2 VKnots_2
puts "Degrees_2 = ${Degrees_2}"
puts "NbPoles_2 = ${NbPoles_2}"
puts "UKnots_2 = ${UKnots_2}"
puts "VKnots_2 = ${VKnots_2}"
#
### 3
#
if {${Degrees_1} != ${Degrees_2}} {
puts "Error : Degrees_1 is not equal Degrees_2"
} else {
puts "OK : Degrees_1 is equal Degrees_2"
}
if {${NbPoles_1} != ${NbPoles_2}} {
puts "Error : NbPoles_1 is not equal NbPoles_2"
} else {
puts "OK : NbPoles_1 is equal NbPoles_2"
}
if {${UKnots_1} != ${UKnots_2}} {
puts "Error : UKnots_1 is not equal UKnots_2"
} else {
puts "OK : UKnots_1 is equal UKnots_2"
}
if {${VKnots_1} != ${VKnots_2}} {
puts "Error : VKnots_1 is not equal VKnots_2"
} else {
puts "OK : VKnots_1 is equal VKnots_2"
}
checkview -display r_1 -2d -path ${imagedir}/${test_image}_1.png
checkview -display r_2 -2d -path ${imagedir}/${test_image}_2.png

View File

@@ -1,40 +0,0 @@
puts "========"
puts "OCC24490"
puts "========"
puts ""
#########################################################################################
# Computed surface properties differ substantially depending on NaturalRestriction flag
#########################################################################################
restore [locate_data_file bug24490_face_naturalrestriction_flag.brep] ff
restore [locate_data_file bug24490_face_naturalrestriction_noflag.brep] fn
# Get information from model ff
set bug_info [sprops ff]
set ff_area [lindex $bug_info 2]
set ff_CG_X [lindex $bug_info 9]
set ff_CG_Y [lindex $bug_info 12]
set ff_CG_Z [lindex $bug_info 15]
# Get information from model ff
set bug_info [sprops fn]
set fn_area [lindex $bug_info 2]
set fn_CG_X [lindex $bug_info 9]
set fn_CG_Y [lindex $bug_info 12]
set fn_CG_Z [lindex $bug_info 15]
# Verification
if {$ff_area != $fn_area} {
puts "ERROR: OCC24490 is reproduced. Areas of identical shapes are different."
}
if {$ff_CG_X != $fn_CG_X} {
puts "ERROR: OCC24490 is reproduced. Center of gravity (X) of identical shapes are different."
}
if {$ff_CG_Y != $fn_CG_Y} {
puts "ERROR: OCC24490 is reproduced. Center of gravity (Y) of identical shapes are different."
}
if {$ff_CG_Z != $fn_CG_Z} {
puts "ERROR: OCC24490 is reproduced. Center of gravity (Z) of identical shapes are different."
}

View File

@@ -1,19 +0,0 @@
puts "========"
puts "OCC24568"
puts "========"
puts ""
##########################################
# Split shape produces an invalid result
##########################################
restore [locate_data_file bug24568_face.brep] face
restore [locate_data_file bug24568_wire.brep] wire
splitshape result face face wire
checkshape result
smallview
donly result
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,31 +0,0 @@
puts "TODO OCC24692 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "========"
puts "OCC24692"
puts "========"
puts ""
#########################################
# fuseedge corruption of spherical edge
#########################################
# Object_1
pcylinder cyl 10 40
box abox 10 40 25
ttranslate abox 0 -20 5
bop cyl abox
bopfuse fuse1
# Object_2
psphere asphere 7
ttranslate asphere 0 0 3
box abox2 5 30 25
ttranslate abox2 -2 -15 -11
bop abox2 asphere
bopfuse fuse2
# Object_Result
bop fuse1 fuse2
bopcut result
fuseedge result
checkshape result_1

View File

@@ -1,45 +0,0 @@
puts "========"
puts "OCC24772"
puts "========"
puts ""
################################################################
# Intersection of cylinder and cone produces incorrect results
################################################################
restore [locate_data_file bug24772_s1.draw] s1
restore [locate_data_file bug24772_s2.draw] s2
smallview +X+Y
fit
zoom 6
set bug_info [intersect r s1 s2]
if {[llength $bug_info] != 4} {
# puts "ERROR: OCC24722 is reproduced."
} else {
# snapshot r_1
clear
display s1
display s2
display r_1
xwd $imagedir/${casename}_r_1.png
# snapshot r_2
clear
display s1
display s2
display r_2
xwd $imagedir/${casename}_r_2.png
# snapshot r_3
clear
display s1
display s2
display r_3
xwd $imagedir/${casename}_r_3.png
# snapshot r_4
clear
display s1
display s2
display r_4
xwd $imagedir/${casename}_r_4.png
}

View File

@@ -0,0 +1,28 @@
puts "TODO OCC24909 ALL: Tcl Exception: Buildsweep : Not Done"
puts "TODO OCC24909 ALL: An exception was caught"
puts "TODO OCC24909 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC24909 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC24909"
puts "========"
puts ""
##################################
# 0024909: SIGSEGV in buildsweep
##################################
restore [locate_data_file bug24909_sweep3-draw-Sweep-0-spine.brep] Sweep-0-spine
mksweep Sweep-0-spine
setsweep -CF
restore [locate_data_file bug24909_sweep3-draw-Sweep-0-section-00-Sketch.brep] Sweep-0-section-00-Sketch
addsweep Sweep-0-section-00-Sketch
restore [locate_data_file bug24909_sweep3-draw-Sweep-0-section-01-Sketch001.brep] Sweep-0-section-01-Sketch001
addsweep Sweep-0-section-01-Sketch001
buildsweep Sweep

View File

@@ -0,0 +1,31 @@
puts "TODO OCC24909 ALL: Tcl Exception: Buildsweep : Not Done"
puts "TODO OCC24909 ALL: An exception was caught"
puts "TODO OCC24909 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC24909 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC24909"
puts "========"
puts ""
##################################
# 0024909: SIGSEGV in buildsweep
##################################
circle c1 0 0 0 40
mkedge e1 c1
wire w1 e1
tcopy w1 Sketch002
tcopy w1 Sketch001
renamevar w1 Sketch
trotate Sketch 0 0 0 0. 1. 0. 90
ttranslate Sketch 0. 0. 75.
trotate Sketch001 0 0 0 0. 1. 0. 90
ttranslate Sketch001 0. 0. -75.
ttranslate Sketch002 50. 0. 0.
mksweep Sketch002
setsweep -CF
addsweep Sketch001
addsweep Sketch
buildsweep Sweep

View File

@@ -0,0 +1,32 @@
puts "TODO OCC24909 ALL: Tcl Exception: Buildsweep : Not Done"
puts "TODO OCC24909 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC24909"
puts "========"
puts ""
##################################
# 0024909: SIGSEGV in buildsweep
##################################
restore [locate_data_file bug24909_minihyd-draw-BezCurve.brep] BezCurve
ttranslate BezCurve 0 -8 0
explode BezCurve E
wire Sweep001-0-spine BezCurve_1
mksweep Sweep001-0-spine
setsweep -CF
circle Circle-curve 0 0 0 18
mkedge Circle-edge Circle-curve 0 0
wire Circle Circle-edge
trotate Circle 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189625731 120
ttranslate Circle 0 -71 203.5
addsweep Circle
circle Circle001-curve 0 0 0 16
mkedge Circle001-edge Circle001-curve 0 0
wire Circle001 Circle001-edge
trotate Circle001 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189625731 120
ttranslate Circle001 0 -71 203.5
addsweep Circle001
buildsweep Sweep001 -C -S

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p 9.08 8.62 3.75 1.87 3.04 9. 4.26 1.37 -0.08 9.08 8.62 3.75
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p -1.15 3.42 1.95 4.54 3.13 1.36 2.97 -3.14 2.08 -1.15 3.42 1.95
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p -4.62 0.1 0.75 -4.12 4.64 -2.91 -1.55 -1.07 4.48 -4.62 0.1 0.75
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p -2.92 -4.7 -2.87 4.73 1.75 1.76 3.14 -1.23 2.74 -2.92 -4.7 -2.87
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p -4.05 3.84 0.17 4.22 3.55 3.19 -1.32 -1.44 -1.57 -4.05 3.84 0.17
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p -2.36 -1.62 0.17 3.26 -1.05 -3.8 2.75 -4.01 4.95 -2.36 -1.62 0.17
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p 4.72 2.03 -2.52 -4.78 1.89 -3.82 -1.42 4.56 1.55 4.72 2.03 -2.52
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p 2.02 -1.4 -3.75 -2.93 -1.87 1.72 -5. -0.18 0.39 2.02 -1.4 -3.75
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -1,53 +0,0 @@
puts "========"
puts "OCC24954"
puts "========"
puts ""
################################################################
# BRepBuilderAPI_MakeFace adds wire with aribitary orientation
################################################################
polyline p 1.21 0.16 4.2 3.12 4.16 0.93 -2.33 -2.55 2.41 1.21 0.16 4.2
wire w p
mkplane f w
# Verify orientation of shapes
set bug_info [whatis p]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis w]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
set bug_info [whatis f]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: Input data is incorrect."
}
# Explode face (f) and verify wire orientation
puts "Checks wires:"
set wire_name_list [explode f w]
set while_count 0
while {$while_count < [llength $wire_name_list]} {
set bug_info [whatis [lindex $wire_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Wire [lindex $wire_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $wire_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}
# Explode face (f) and verify edge orientation
puts "Checks edges:"
set edge_name_list [explode f e]
set while_count 0
while {$while_count < [llength $edge_name_list]} {
set bug_info [whatis [lindex $edge_name_list $while_count]]
if {[lindex $bug_info 5] != "FORWARD"} {
puts "ERROR: OCC24954 is reproduced. Edge [lindex $edge_name_list $while_count] has REVERSED orientation."
} else {
puts " [lindex $edge_name_list $while_count] has FORWARD orientation."
}
set while_count [expr {$while_count + 1}]
}

View File

@@ -0,0 +1,15 @@
puts "TODO OCC24997 ALL: An exception was caught"
puts "TODO OCC24997 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC24997 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC24997"
puts "========"
puts ""
#########################################
# SIGSEGV in BRepOffsetAPI_ThruSections
#########################################
restore [locate_data_file bug24997_loft3-draw-Loft-00-section.brep] Loft-00-section
restore [locate_data_file bug24997_loft3-draw-Loft-01-section.brep] Loft-01-section
thrusections Loft 0 0 Loft-00-section Loft-01-section

View File

@@ -1,18 +0,0 @@
puts "========"
puts "OCC25023"
puts "========"
puts ""
###################################
# Check fails after cut operation
###################################
restore [locate_data_file bug25023_a.brep] a
checkshape a
restore [locate_data_file bug25023_b.brep] b
checkshape b
bopargcheck b a -C
bcut result b a
checkshape result

View File

@@ -0,0 +1,22 @@
puts "TODO OCC25081 ALL: TEST INCOMPLETE"
puts "TODO OCC25081 ALL: Process killed by CPU limit"
puts "========"
puts "OCC25081"
puts "========"
puts ""
############################
# bopcheck does not return
############################
cpulimit 1200
restore [locate_data_file bug25081_v1-sweep-draw-Sweep-0-spine.brep] Sweep-0-spine
restore [locate_data_file bug25081_v1-sweep-draw-Sweep-0-section-00-Wire.brep] Sweep-0-section-00-Wire
mksweep Sweep-0-spine
setsweep -FR
addsweep Sweep-0-section-00-Wire
buildsweep Sweep -C -S
bopcheck Sweep

View File

@@ -1,18 +0,0 @@
puts "TODO OCC25104 ALL: ERROR: OCC25104 is reproduced."
puts "========"
puts "OCC25104"
puts "========"
puts ""
##########################################################
# 0025104: Prism from BSpline curve can not be chamfered
##########################################################
restore [locate_data_file bug25104_whale2-draw-path.brep] path
prism Extrude001 path 0. 0. 5.
set bug_info [string trim [bopcheck Extrude001]]
if {$bug_info != "This shape seems to be OK."} {
puts "ERROR: OCC25104 is reproduced. Prism has been created with errors."
}

View File

@@ -0,0 +1,20 @@
puts "TODO OCC25110 ALL: An exception was caught"
puts "TODO OCC25110 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC25110 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC25110"
puts "========"
puts ""
########################################################################################
# TCollection_IndexedDataMap::FindFromKey error when sweeping circle along BezierCurve
########################################################################################
restore [locate_data_file bug25110_unsweepable1-draw-Sweep-0-spine.brep] Sweep-0-spine
restore [locate_data_file bug25110_unsweepable1-draw-Sweep-0-section-00-Circle.brep] Sweep-0-section-00-Circle
mksweep Sweep-0-spine
setsweep -CF
addsweep Sweep-0-section-00-Circle
buildsweep Sweep -C -S

View File

@@ -1,31 +0,0 @@
puts "TODO OCC25206 ALL: ERROR: OCC25206 is reproduced."
puts "========"
puts "OCC25206"
puts "========"
puts ""
##########################################
# Fillet creates edge with C0 continuity
##########################################
restore [locate_data_file bug25206_lampe-1-draw-Fusion.brep] Fusion
explode Fusion E
set edges [explode Fusion E]
blend Fillet Fusion 25 Fusion_4 25 Fusion_5 25 Fusion_6 25 Fusion_7 25 Fusion_8 25 Fusion_9 25 Fusion_10 25 Fusion_11 25 Fusion_12
explode Fillet E
renamevar Fillet_8 E8
set bug_info [dump E8]
# Find section "VKnots" in dump and cut it
set bug_info [string trim [string range $bug_info [string first "VKnots" $bug_info] [expr {[string length $bug_info] - 1}]]]
# Get value for VKnots #7
set VKnots_7 [lindex $bug_info 29]
# Get value for VKnots #8
set VKnots_8 [lindex $bug_info 33]
# Check CO continuity
if {$VKnots_7 == 8 && $VKnots_8 == 9} {
puts "ERROR: OCC25206 is reproduced. CO continuity has been detected."
}

View File

@@ -1,24 +0,0 @@
puts "TODO OCC25385 ALL: is not equal to expected"
puts "============"
puts "OCC25385"
puts "============"
puts ""
#######################################################################
# steep increase in tolerance by intersection
#######################################################################
restore [locate_data_file bug25385_shell2.brep] s
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance s] full MaxTol_s_1
plane p 28.5 0 0 1 0 0 0 1 0
mkface f p
bop s f
bopsection r
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance s] full MaxTol_s_2
set tol_abs_MaxTol 0.0001
set tol_rel_MaxTol 0.0001
checkreal "MaxTolerance " ${MaxTol_s_2} ${MaxTol_s_1} ${tol_abs_MaxTol} ${tol_rel_MaxTol}

View File

@@ -1,18 +0,0 @@
puts "TODO OCC25395 ALL: ERROR. offsetperform operation not done."
puts "========"
puts "OCC25395"
puts "========"
puts ""
#######################################################
# SIGSEGV in BRepOffsetAPI_MakeThickSolid
#######################################################
restore [locate_data_file bug25395_thickness2-s1.brep] s1
explode s1 F
offsetparameter 1e-7 p a
offsetload s1 1 s1_2 s1_3 s1_4
offsetperform Thickness
checkview -display Thickness -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,49 +0,0 @@
puts "TODO OCC25395 ALL: Standard_ConstructionError"
puts "TODO OCC25395 ALL:TEST INCOMPLETE"
puts "========"
puts "OCC25395"
puts "========"
puts ""
#######################################################
# SIGSEGV in BRepOffsetAPI_MakeThickSolid
#######################################################
ellipse Ellipse-curve 0 0 0 100.87 22
mkedge Ellipse-edge Ellipse-curve 0 6.28318530718
wire Ellipse-wire Ellipse-edge
mkplane Ellipse Ellipse-wire
ttranslate Ellipse 0 -27 184.5
explode Ellipse E
wire Sweep-0-spine Ellipse_1
mksweep Sweep-0-spine
setsweep -CF
circle Circle-curve 0 0 0 18
mkedge Circle-edge Circle-curve 0 0
wire Circle Circle-edge
trotate Circle 0 0 0 0 -1 0 90
ttranslate Circle 0 -70 202.5
addsweep Circle
buildsweep Sweep -C -S
box Box001 300 90 300
ttranslate Box001 -150 -27 0
bcut Cut031 Sweep Box001
box Box002 300 100 30
ttranslate Box002 -150 -100 202.5
bcut Cut032 Cut031 Box002
explode Cut032 F
offsetparameter 1e-7 p a
offsetload Cut032 1 Cut032_3 Cut032_2 Cut032_4
offsetperform Thickness
checkview -display Thickness -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,34 +0,0 @@
puts "TODO OCC25458 ALL: Error : 1-fold tori is bad"
puts "============"
puts "OCC25458"
puts "============"
puts ""
###########################################################################
## can a sweep be used to create 1-fold tori (using a closed wire as path)
###########################################################################
restore [locate_data_file bug25458_sweep-torus1-draw-Wire.brep] Wire
explode Wire E
wire Sweep-0-spine Wire_1
mksweep Sweep-0-spine
setsweep -FR
circle Circle-curve 0 0 0 10
mkedge Circle-edge Circle-curve 0 0
wire Circle Circle-edge
trotate Circle 0 0 0 1 0 0 90
ttranslate Circle 40.1121575545 0 36.5930306315
addsweep Circle
buildsweep Sweep -C -S
set info [bopcheck Sweep]
if { [regexp "This shape seems to be OK" ${info}] != 1 } {
puts "Error : 1-fold tori is bad"
}
checkview -display Sweep -3d -path ${imagedir}/${test_image}.png

View File

@@ -1,22 +0,0 @@
puts "TODO OCC25478 ALL: Error: Fillets can not touch"
puts "============"
puts "OCC25478"
puts "============"
puts ""
########################
# Fillets can not touch
########################
box Box 10 10 10
explode Box E
catch { blend Fillet Box 5 Box_1 5 Box_3 } msg
if { [info exist Fillet] == 0 } {
puts "Error: Fillets can not touch"
} else {
puts "OK: Fillets can touch"
}
checkview -display Fillet -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,25 +0,0 @@
puts "TODO OCC25478 ALL: Error: Fillets can not touch"
puts "============"
puts "OCC25478"
puts "============"
puts ""
########################
# Fillets can not touch
########################
box Box001 10 10 10
box Box002 10 10 12
ttranslate Box002 5 5 -1
bcut Cut Box001 Box002
explode Cut E
catch { blend Fillet002 Cut 2.5 Cut_13 2.5 Cut_17 2.5 Cut_18 } msg
if { [info exist Fillet002] == 0 } {
puts "Error: Fillets can not touch"
} else {
puts "OK: Fillets can touch"
}
checkview -display Fillet002 -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,19 +0,0 @@
puts "TODO OCC25521 ALL: Faulty shapes in variables faulty_1 to"
puts "============"
puts "OCC25521"
puts "============"
puts ""
######################################################
# Fillet creates shell with bad orientation of SubShape
######################################################
restore [locate_data_file bug25521_fillet-suborient3-draw-s1.brep] s1
ttranslate s1 0 0 3
explode s1 E
blend Fillet s1 2 s1_4
checkshape Fillet
checkview -display Fillet -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,23 +0,0 @@
puts "TODO OCC25626 ALL: Error : is WRONG because number of EDGE entities"
puts "TODO OCC25626 ALL: Error : is WRONG because number of WIRE entities"
puts "============"
puts "OCC25626"
puts "============"
puts ""
############################################################################
# Loft of ellipses shows wrinkle near seam edge
############################################################################
restore [locate_data_file bug25626_loft-el1-draw-Loft-00-section.brep] Loft-00-section
restore [locate_data_file bug25626_loft-el1-draw-Loft-01-section.brep] Loft-01-section
restore [locate_data_file bug25626_loft-el1-draw-Loft-02-section.brep] Loft-02-section
thrusections Loft 0 0 Loft-00-section Loft-01-section Loft-02-section
checkshape Loft
checknbshapes Loft -wire 1 -edge 3
checkview -display Loft -2d -path ${imagedir}/${test_image}-2d.png
checkview -display Loft -3d -path ${imagedir}/${test_image}-3d.png

View File

@@ -1,28 +0,0 @@
puts "TODO OCC25730 ALL: result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0"
puts "============"
puts "OCC25730"
puts "============"
puts ""
#############################################################################################
## result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0
#############################################################################################
restore [locate_data_file bug25730_thickness8-draw-fillet001.brep] Fillet001
explode Fillet001 F
offsetparameter 1e-7 p a
offsetload Fillet001 -1 Fillet001_4
offsetperform Thickness
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck Fillet001]] == 1 } {
puts "Error : result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0"
}
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck Thickness]] == 1 } {
puts "Error : result of MakeThickSolid aborts the BOPCheck in Geom_OffsetSurface::SetD0"
}
checkview -display Fillet001 -2d -path ${imagedir}/${test_image}-Fillet001-2d.png
checkview -display Thickness -2d -path ${imagedir}/${test_image}-Thickness-2d.png

View File

@@ -1,36 +0,0 @@
puts "TODO OCC25776 ALL: Error : Number of edges is WRONG"
puts "============"
puts "OCC25776"
puts "============"
puts ""
##############################################################
## HLR returns intersecting edges in OutLineV of helical sweep
##############################################################
restore [locate_data_file bug25776_shape2dhelix1-draw-Shape.brep] Shape
hprj Shape2DView_proj 0 0 0 1 0 0 0 1 0
houtl Shape2DView_outl Shape
hfill Shape2DView_outl Shape2DView_proj 0
hload Shape2DView_outl
hsetprj Shape2DView_proj
hupdate
hhide
hres2d
# vol_2 and vol_3 - bad edges
checknbshapes vol -edge 9 -m "Number of edges"
smallview
top
donly vol
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}-2d.png
vinit
vsetdispmode 1
vdisplay Shape
vright
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}-3d-right.png

View File

@@ -1,27 +0,0 @@
puts "TODO OCC25798 ALL: Faulty shapes in variables faulty_1 to"
puts "============"
puts "OCC25798"
puts "============"
puts ""
##############################################
# BRepFeat_SplitShape returns invalid result
##############################################
restore [locate_data_file bug25798_Pump2.brep] p
explode p
checkshape p
whatis p
renamevar p_1 f
checkshape f
explode f
splitshape result f_4 f_4 p_5
whatis result
checkshape result
tolerance result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,22 +0,0 @@
puts "TODO OCC25856 ALL: Faulty shapes in variables faulty_1 to"
puts "============"
puts "OCC25856"
puts "============"
puts ""
#############################################################################################
# BRepOffsetAPI_ThruSections returns an invalid shape if one wire contains degenerated edges
#############################################################################################
restore [locate_data_file bug25856_threeWires.brep] t
explode t
thrusections -N r 0 0 t_1 t_2
checkshape r
fixshape rr r
checkshape rr
checkview -display r -2d -path ${imagedir}/${test_image}_1.png
checkview -display rr -2d -path ${imagedir}/${test_image}_2.png

View File

@@ -1,20 +0,0 @@
puts "============"
puts "OCC25856"
puts "============"
puts ""
#############################################################################################
# BRepOffsetAPI_ThruSections returns an invalid shape if one wire contains degenerated edges
#############################################################################################
restore [locate_data_file bug25856_threeWires.brep] t
explode t
thrusections -N r 0 0 t_1 t_2 t_3
checkshape r
fixshape rr r
checkshape rr
checkview -display r -2d -path ${imagedir}/${test_image}_1.png
checkview -display rr -2d -path ${imagedir}/${test_image}_2.png

View File

@@ -1,20 +0,0 @@
puts "TODO OCC25879 ALL: Error : result of blend fails the bopcheck"
puts "============"
puts "OCC25879"
puts "============"
puts ""
######################################################
# result of blend fails the bopcheck
######################################################
box Box 10 10 10
explode Box E
blend Fillet Box 1 Box_1 1 Box_2 1 Box_3 1 Box_4 1 Box_5 1 Box_6 1 Box_7 1 Box_8 1 Box_9 1 Box_10 1 Box_11 1 Box_12
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck Fillet]] == 1 } {
puts "Error : result of blend fails the bopcheck"
}
checkview -display Fillet -2d -path ${imagedir}/${test_image}-2d.png

View File

@@ -1,16 +0,0 @@
puts "TODO OCC25979 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "========"
puts "OCC25979"
puts "========"
puts ""
##############################################
# fillet creates faces with non-closed wires
##############################################
restore [locate_data_file bug25979_fillet-missingface1-tcl-Fillet005.brep] Fillet005
explode Fillet005 E
blend Fillet003 Fillet005 1.27 Fillet005_1 1.27 Fillet005_2 1.27 Fillet005_3 1.27 Fillet005_4 1.27 Fillet005_5 1.27 Fillet005_7 1.27 Fillet005_8 1.27 Fillet005_10 1.27 Fillet005_11 1.27 Fillet005_12 1.27 Fillet005_13 1.27 Fillet005_14 1.27 Fillet005_15 1.27 Fillet005_16 1.27 Fillet005_17 1.27 Fillet005_18 1.27 Fillet005_19 1.27 Fillet005_20 1.27 Fillet005_21 1.27 Fillet005_22 1.27 Fillet005_23 1.27 Fillet005_24 1.27 Fillet005_25 1.27 Fillet005_26 1.27 Fillet005_27 1.27 Fillet005_28 1.27 Fillet005_29 1.27 Fillet005_30 1.27 Fillet005_31 1.27 Fillet005_33 1.27 Fillet005_34 1.27 Fillet005_35 1.27 Fillet005_36 1.27 Fillet005_37 1.27 Fillet005_38 1.27 Fillet005_39 1.27 Fillet005_40 1.27 Fillet005_41 1.27 Fillet005_42 1.27 Fillet005_43 1.27 Fillet005_44 1.27 Fillet005_46 1.27 Fillet005_47 1.27 Fillet005_48 1.27 Fillet005_49 1.27 Fillet005_50
checkshape Fillet003

View File

@@ -1,24 +0,0 @@
puts "TODO OCC25983 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "========"
puts "OCC25983"
puts "========"
puts ""
##########################################
# Fusion of sweep and its mirror invalid
##########################################
restore [locate_data_file bug25983_deform-fusion1-tcl-BSpline.brep] BSpline
wire Knurling-0-spine BSpline
mksweep Knurling-0-spine
setsweep -FR
polyline DWire 0 0 0 1 -0.9999999999999998 0 1.0000000000000002 0.9999999999999998 0 0 0 0
trotate DWire 0 0 0 1 0 0 134.99999999999693
ttranslate DWire 9 0 0
addsweep DWire
buildsweep Knurling -C -S
copy Knurling Clone
tmirror Clone 0 0 0 1 0 0
bfuse result Knurling Clone
checkshape result

View File

@@ -1,18 +0,0 @@
puts "========"
puts "OCC25994"
puts "========"
puts ""
#########################################
# Boolean fuse result in invalid result
#########################################
restore [locate_data_file bug25994_body.brep] body
restore [locate_data_file bug25994_wing.brep] wing
bfuse result body wing
checkshape result
smallview
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,21 @@
puts "TODO OCC26030 ALL: An exception was caught"
puts "TODO OCC26030 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC26030 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC26030"
puts "========"
puts ""
#################################################
# Offset of a lofted body fails after long time
#################################################
restore [locate_data_file bug26030_thickness-crash1-tcl-Loft001-00-section.brep] Loft001-00-section
restore [locate_data_file bug26030_thickness-crash1-tcl-Loft001-01-section.brep] Loft001-01-section
thrusections Loft001 1 0 Loft001-00-section Loft001-01-section
explode Loft001 F
offsetparameter 1e-7 p i
offsetload Loft001 1
offsetperform Offset

View File

@@ -1,21 +0,0 @@
puts "========"
puts "OCC26034"
puts "========"
puts ""
##########################################################
# Result of revolution aborts the bopcheck if translated
##########################################################
restore [locate_data_file bug26034_revolve-seg1-tcl-Revolve002.brep] Revolve002
set bug_info [ string trim [bopcheck Revolve002]]
if {$bug_info != "This shape seems to be OK."} {
puts "ERROR: Initial shape is invalid."
}
ttranslate Revolve002 0 0 -0.5
set bug_info [ string trim [bopcheck Revolve002]]
if {$bug_info != "This shape seems to be OK."} {
puts "ERROR: OCC26034 is reproduced. bopcheck gives incorrect result after ttranslate operation."
}

View File

@@ -1,18 +0,0 @@
puts "TODO OCC26077 ALL: ERROR: OCC26077 is reproduced."
puts "========"
puts "OCC26077"
puts "========"
puts ""
#################################################
# nurbsconvert of psphere fails the bopargcheck
#################################################
psphere s 10
nurbsconvert result s
set bug_info [string trim [bopargcheck result]]
if {$bug_info != "Shape(s) seem(s) to be valid for BOP."} {
puts "ERROR: OCC26077 is reproduced. Command bopargcheck returns FAIL status for nurbsconvert of sphere."
}

View File

@@ -1,57 +0,0 @@
puts "TODO OCC26077 ALL: Error: Boolean operation of the given type is not allowed on the given inputs"
puts "TODO OCC26077 ALL: ERROR: OCC26077 is reproduced."
puts "TODO OCC26077 ALL: ERROR: Problematic shape in OCC26077:"
puts "========"
puts "OCC26077"
puts "========"
puts ""
#################################################
# nurbsconvert of psphere fails the bopargcheck
#################################################
ellipse Ellipse002-untrimmed 0 0 0 8.2 6.2
mkedge Ellipse002 Ellipse002-untrimmed 0 6.283185307179586
trotate Ellipse002 0 0 0 0 0 1 90
ttranslate Ellipse002 0 0 15
prism Extrude_Ellipse Ellipse002 0 0 6
ttranslate Extrude_Ellipse 0 0 -4
restore [locate_data_file bug26077_ellipsoid1-tcl-Loft-00-section.brep] Loft-00-section
restore [locate_data_file bug26077_ellipsoid1-tcl-Loft-01-section.brep] Loft-01-section
thrusections Loft 1 0 Loft-00-section Loft-01-section
psphere Ellipsoid-sphere 12.5
deform Ellipsoid Ellipsoid-sphere 1 1.04 1.2
set bug_info [string trim [bopargcheck Loft]]
if {$bug_info != "Shape(s) seem(s) to be valid for BOP."} {
puts "ERROR: Problematic shape in OCC26077: Shape Loft is not valid for BOP."
}
set bug_info [string trim [bopargcheck Ellipsoid]]
if {$bug_info != "Shape(s) seem(s) to be valid for BOP."} {
puts "ERROR: Problematic shape in OCC26077: Shape Ellipsoid is not valid for BOP."
}
set bug_info [string trim [bfuse Fusion Loft Ellipsoid]]
if {[string length $bug_info] == 0} {
puts "OCC26077: Operation bfuse (bfuse Fusion Loft Ellipsoid) has been finished with OK status."
} else {
puts "ERROR: OCC26077 is reproduced. Operation bfuse (bfuse Fusion Loft Ellipsoid) has been finished with KO status."
}
set bug_info [string trim [bopargcheck Extrude_Ellipse]]
if {$bug_info != "Shape(s) seem(s) to be valid for BOP."} {
puts "ERROR: Problematic shape in OCC26077: Shape Extrude_Ellipse is not valid for BOP."
}
set bug_info [string trim [bopargcheck Fusion]]
if {$bug_info != "Shape(s) seem(s) to be valid for BOP."} {
puts "ERROR: Problematic shape in OCC26077: Shape Fusion is not valid for BOP."
}
set bug_info [string trim [bfuse Fusion002 Extrude_Ellipse Fusion]]
if {[string length $bug_info] == 0} {
puts "OCC26077: Operation bfuse (bfuse Fusion002 Extrude_Ellipse Fusion) has been finished with OK status."
} else {
puts "ERROR: OCC26077 is reproduced. Operation bfuse (bfuse Fusion002 Extrude_Ellipse Fusion) has been finished with KO status."
}

View File

@@ -0,0 +1,16 @@
puts "TODO OCC26088 ALL: An exception was caught"
puts "TODO OCC26088 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC26088 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC26088"
puts "========"
puts ""
###############################
# Exception in pipe algorithm
###############################
restore [locate_data_file bug26088_path0.brep] p
restore [locate_data_file bug26088_profile0.brep] pr
pipe result p pr

View File

@@ -1,22 +0,0 @@
puts "========"
puts "OCC28112"
puts "========"
puts ""
####################################################################################
## Exception during offset computation
####################################################################################
restore [locate_data_file bug28112.brep] s
regexp {Mass +: +([-0-9.+eE]+)} [lprops s 1.e-4] full s_len
regexp {Mass +: +([-0-9.+eE]+)} [sprops s 1.e-4] full s_area
for {set i -5} {$i <= 5} {incr i} {
set offsetvalue [expr 6. * $i]
offsetshapesimple result s ${offsetvalue}
checkshape result
checkprops result -l ${s_len}
checkprops result -s ${s_area}
checknbshapes result -vertex 12 -edge 15 -face 3
}

View File

@@ -1,23 +0,0 @@
puts "========"
puts "OCC28944"
puts "========"
puts ""
#######################################################
# Cannot find section between two faces
#######################################################
restore [locate_data_file bug28944_shell.brep] sh0
plane pl0 28.0 0.0 0.0 1.0 0.0 0.0
mkface f0 pl0 -50 50 -50 50
# Incomplete section
bsection result sh0 f0
regexp {nb alone Vertices : ([-0-9.+eE]+)} [checksection result] full nbv
if { $nbv != 0 } { puts "Error : Section is incorrect" }
checknbshapes result -vertex 2 -edge 2
checkprops result -l 6.91796
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,18 +0,0 @@
puts "========"
puts "OCC28982"
puts "========"
puts ""
########################################
# 2D offset creates faulty result from wire
########################################
restore [locate_data_file bug28982_ellipse.brep] e
mkoffset result e 1 1
checkshape result_1
if {![regexp "This shape seems to be OK" [bopcheck result_1]]} {
puts "Error: The resulting wire is self-interfered"
}
checkprops result_1 -l 305.299
checkview -display result_1 -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,35 +0,0 @@
puts "========"
puts "OCC23866"
puts "========"
puts ""
########################################
# GccAna_Circ2d3Tan does not find a circle
########################################
restore [locate_data_file bug23866_3curves.brep] 3curves
explode 3curves
mkcurve 3d_curve_1 3curves_1
mkcurve 3d_curve_2 3curves_2
mkcurve 3d_curve_3 3curves_3
to2d 2d_curve_1 3d_curve_1
to2d 2d_curve_2 3d_curve_2
to2d 2d_curve_3 3d_curve_3
set circles_Nb [llength [cirtang cir 2d_curve_1 2d_curve_2 2d_curve_3] ]
if { ${circles_Nb} != 8 } {
puts "Error: GccAna_Circ2d3Tan does not find a circle"
} else {
puts "OK: GccAna_Circ2d3Tan find a circle"
checklength cir_1 -l 9429.8727947293246
checklength cir_2 -l 888.65915068757909
checklength cir_3 -l 8.5227983514817236
checklength cir_4 -l 6.2260879234386
checklength cir_5 -l 14054.240322333564
checklength cir_6 -l 596.25725451268329
checklength cir_7 -l 7.6941358383928531
checklength cir_8 -l 6.8966408969867814
}

View File

@@ -0,0 +1,17 @@
puts "TODO OCC24621 ALL: An exception was caught"
puts "TODO OCC24621 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO OCC24621 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC24621"
puts "========"
puts ""
##################################################
# Failed to build Geom_OffsetSurface on B-Spline
##################################################
restore [locate_data_file bug24621_bs.draw] bs
offset obs bs -2
setunotperiodic bs
offset obs bs -2

View File

@@ -1,45 +0,0 @@
puts "TODO OCC25481 ALL: unexpected polygons are found"
puts "TODO OCC25481 ALL: unexpected pcurves are found"
puts "================"
puts "OCC25481"
puts "================"
puts ""
#######################################################################
# Edge must not contain obsolete curve representations
#######################################################################
pcylinder c 1 1
incmesh c 0.1 -a 60
subshape c e 1
unset c
renamevar c_1 e
polygons e
set dmp [dump e]
set npol 0
set npc 0
foreach l [split $dmp \n] {
if [regexp -- {- PCurve} $l dummy dummy] {
puts $l
incr npc
}
if [regexp -- {- PolygonOnTriangulation} $l dummy dummy] {
puts $l
incr npol
}
}
if $npol {
puts "Error : $npol unexpected polygons are found"
} else {
puts "OK : unexpected polygons are not found"
}
if $npc {
puts "Error : $npc unexpected pcurves are found"
} else {
puts "OK : unexpected pcurves are not found"
}
checkview -display e -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,17 +0,0 @@
puts "TODO OCC25693 ALL: Wire of BSplines fails bopcheck"
puts "============"
puts "OCC25693"
puts "============"
puts ""
###############################
## Wire of BSplines fails bopcheck
###############################
restore [locate_data_file bug25693_path3035.brep] result
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck result]] == 1 } {
puts "Error : Wire of BSplines fails bopcheck"
}
checkview -display result -2d -path ${imagedir}/${test_image}-2d.png

View File

@@ -1,24 +0,0 @@
puts "TODO OCC25693 ALL: Wire of BSplines fails bopcheck"
puts "============"
puts "OCC25693"
puts "============"
puts ""
###############################
## Wire of BSplines fails bopcheck
###############################
restore [locate_data_file bug25693_path3039.brep] path3039
prism Extrude_path3039 path3039 0 0 50
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck path3039]] == 1 } {
puts "Error : bad shape"
}
if { [regexp "There were errors during the operation, so the list may be incomplete" [bopcheck Extrude_path3039]] == 1 } {
puts "Error : Wire of BSplines fails bopcheck"
}
checkview -display path3039 -2d -path ${imagedir}/${test_image}-path3039-2d.png
checkview -display Extrude_path3039 -2d -path ${imagedir}/${test_image}-Extrude_path3039-2d.png

View File

@@ -1,41 +0,0 @@
puts "TODO OCC25989 ALL: Error : The volume of result shape is"
puts "========"
puts "OCC25989"
puts "========"
puts ""
################################################
# toridial surface gets damaged in STEP export
################################################
set StepFileName ${imagedir}/${casename}_fusion-step1-out.step
catch {exec rm ${StepFileName}}
box Box 10 10 10
pcylinder Cylinder 2 10
psphere Sphere 5
ptorus Torus 10 2
bclearobjects
bcleartools
baddobjects Box
baddtools Cylinder Sphere Torus
bfillds
bbop Fusion 1
checkshape Fusion
bopcheck Fusion
set FusionVolume [lindex [string trim [vprops Fusion]] 2]
stepwrite m Fusion
writeall $StepFileName
stepread $StepFileName a *
renamevar a_1 result
checkshape result
bopcheck result
checkprops result -v $FusionVolume

View File

@@ -1,25 +0,0 @@
puts "TODO CR25852 ALL: Faulty shapes in variables faulty_1 to"
puts "============"
puts "CR25852"
puts "============"
puts ""
################################################################
# Text to BRep algorithm produces bad faces for circled symbols
################################################################
text2brep t "\u00ae" Courier 10
whatis t
vinit View1
vclear
vtop
vsetdispmode 1
vdisplay t
vfit
vmoveto 250 250
checkshape t
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -1,41 +0,0 @@
#INTERFACE CAF
# Basic attributes
#
# Testing order of attributes on Undo/Redo
#
# Testing command: SetInteger
# Testing command: GetReal
# Testing command: Undo and Redo
#
puts "caf001-B8"
NewCommand D
SetInteger D 0:1 123
SetReal D 0:1 123.321
NewCommand D
CheckLabel D 0:1
set res1 [CheckLabel D 0:1]
set indexReal1 [lsearch ${res1} TDataStd_Real]
set indexInt1 [lsearch ${res1} TDataStd_Integer]
if { ${indexReal1} != 5} {
puts "Error: Wrong position 1 of TDataStd_Real attribute."
}
if { ${indexInt1} != 11} {
puts "Error: Wrong position 1 of TDataStd_Integer attribute."
}
Undo D
Redo D
CheckLabel D 0:1
set res2 [CheckLabel D 0:1]
set indexReal2 [lsearch ${res2} TDataStd_Real]
set indexInt2 [lsearch ${res2} TDataStd_Integer]
if { ${indexReal1} != ${indexReal2}} {
puts "Error: Wrong position 2 of TDataStd_Real attribute."
}
if { ${indexInt1} != ${indexInt2}} {
puts "Error: Wrong position 2 of TDataStd_Integer attribute."
}

View File

@@ -1,40 +0,0 @@
puts "================"
puts "bug0028946"
puts "================"
puts ""
######################################################
# Checks bug of Undo mechanism
######################################################
set aLab [Label D 0:1]
#1. Add to Main label two numeric attributes
SetInteger D $aLab 1
SetReal D $aLab 1.5
#2. Forget Integer attribute
NewCommand D
ForgetAtt D $aLab 2a96b606-ec8b-11d0-bee7-080009dc3333
#3. Set new Integer attribute
SetInteger D $aLab 3
NewCommand D
#4. make Undo
set IsGood 1
if [catch {Undo D}] {
puts "Error during Document Undo"
set IsGood 0
}
#5. Check result
if {$IsGood == 1} {
puts "bug0028946: OK"
} else {
puts "bug0028946: ERROR"
}
#6. Close document
Close D

View File

@@ -1 +0,0 @@
cpulimit 1000

View File

@@ -1,3 +0,0 @@
puts ""
puts "TEST COMPLETED"
puts ""

View File

@@ -1,2 +0,0 @@
001 stl_read
002 shape_write_stl

View File

@@ -1,15 +0,0 @@
# Read brep file
restore [locate_data_file bug28840_1.brep] m
# Mesh it
incmesh m 1.0
# Save, read and delete file
writestl m $imagedir/${casename}
readstl res $imagedir/${casename} triangulation
file delete $imagedir/${casename}
checktrinfo res -tri 22748 -nod 11376
# Visual check
checkview -display res -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,15 +0,0 @@
# Read brep file
restore [locate_data_file bug28840_10.brep] m
# Mesh it
incmesh m 1.0
# Save, read and delete file
writestl m $imagedir/${casename}
readstl res $imagedir/${casename} triangulation
file delete $imagedir/${casename}
checktrinfo res -tri 130 -nod 67
# Visual check
checkview -display res -2d -path ${imagedir}/${test_image}.png

Some files were not shown because too many files have changed in this diff Show More