mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
32c19c4cd4 | ||
|
ed20837d8b | ||
|
2ab4e9e180 | ||
|
d83d72acf9 | ||
|
fae5678dc7 | ||
|
488c43ed0c |
13
.github/workflows/codemsvc.yml
vendored
13
.github/workflows/codemsvc.yml
vendored
@@ -56,14 +56,7 @@ jobs:
|
||||
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test
|
||||
|
||||
# Upload SARIF file to GitHub Code Scanning Alerts
|
||||
#- name: Upload SARIF to GitHub
|
||||
# uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
# with:
|
||||
# sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
||||
# Upload SARIF file as an Artifact to download and view
|
||||
- name: Upload SARIF as an Artifact
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
with:
|
||||
name: sarif-file
|
||||
path: ${{ steps.run-analysis.outputs.sarif }}
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
elseif(MINGW)
|
||||
add_definitions(-D_WIN32_WINNT=0x0601)
|
||||
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
|
||||
|
@@ -479,8 +479,8 @@ if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
|
||||
if (USE_QT)
|
||||
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
|
||||
|
@@ -11,7 +11,7 @@ project (ImportExport)
|
||||
add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/src)
|
||||
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/src)
|
||||
set (ImportExport_HEADER_FILES ${ImportExport_SRC_DIR}/ColoredShapes.h
|
||||
${ImportExport_SRC_DIR}/ImportExportApp.h
|
||||
${ImportExport_SRC_DIR}/ImportExportDoc.h
|
||||
@@ -21,7 +21,7 @@ set (ImportExport_SOURCE_FILES ${ImportExport_SRC_DIR}/ColoredShapes.cpp
|
||||
${ImportExport_SRC_DIR}/ImportExportDoc.cpp
|
||||
${ImportExport_SRC_DIR}/StdAfx.cpp)
|
||||
|
||||
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/res)
|
||||
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/res)
|
||||
set (ImportExport_RESOURCE_HEADER ${ImportExport_RESOURCE_DIR}/resource.h)
|
||||
set (ImportExport_RESOURCE_FILES ${ImportExport_RESOURCE_DIR}/Toolbar.bmp
|
||||
${ImportExport_RESOURCE_DIR}/ImportExport.rc)
|
||||
@@ -55,7 +55,7 @@ else()
|
||||
endif()
|
||||
|
||||
include_directories (${CMAKE_BINARY_DIR}/inc
|
||||
${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport
|
||||
${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport
|
||||
${ImportExport_SRC_DIR}
|
||||
${MFC_STANDARD_SAMPLES_DIR}/Common)
|
||||
|
||||
|
@@ -11,7 +11,7 @@ project (HLR)
|
||||
add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/src)
|
||||
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/src)
|
||||
set (HLR_HEADER_FILES ${HLR_SRC_DIR}/HLRApp.h
|
||||
${HLR_SRC_DIR}/HLRDoc.h
|
||||
${HLR_SRC_DIR}/HLRView2D.h
|
||||
@@ -23,7 +23,7 @@ set (HLR_SOURCE_FILES ${HLR_SRC_DIR}/HLRApp.cpp
|
||||
${HLR_SRC_DIR}/SelectionDialog.cpp
|
||||
${HLR_SRC_DIR}/StdAfx.cpp )
|
||||
|
||||
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/res)
|
||||
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/res)
|
||||
set (HLR_RESOURCE_HEADER ${HLR_RESOURCE_DIR}/resource.h)
|
||||
set (HLR_RESOURCE_FILES ${HLR_RESOURCE_DIR}/axoviewd.bmp
|
||||
${HLR_RESOURCE_DIR}/axoviewf.bmp
|
||||
|
@@ -82,7 +82,6 @@ set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.hxx
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h
|
||||
|
@@ -264,12 +264,12 @@ static Standard_Boolean KPartCircle
|
||||
}
|
||||
else if (AHC->GetType() == GeomAbs_Circle)
|
||||
{
|
||||
if (E.Orientation() == TopAbs_FORWARD)
|
||||
anOffset *= -1;
|
||||
if (!BRep_Tool::IsClosed(E))
|
||||
// Reverse the offset function when the edge is FORWARD and CLOSED
|
||||
if (E.Orientation() == TopAbs_FORWARD && BRep_Tool::IsClosed(E))
|
||||
{
|
||||
anOffset *= -1;
|
||||
}
|
||||
|
||||
gp_Circ2d theCirc = AHC->Circle();
|
||||
if (anOffset > 0. || Abs(anOffset) < theCirc.Radius())
|
||||
OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() + anOffset);
|
||||
|
@@ -562,40 +562,54 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getCylinderCircles
|
||||
//function : getCylinderHeight
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static NCollection_Array1<gp_Circ> getCylinderCircles (const TopoDS_Face& theHollowCylinder, Standard_Size& theNumCircles)
|
||||
static Standard_Real getCylinderHeight (const Handle(Poly_Triangulation)& theTriangulation,
|
||||
const TopLoc_Location& theLoc)
|
||||
{
|
||||
NCollection_Array1<gp_Circ> aCircles (1, 2);
|
||||
theNumCircles = 0;
|
||||
Standard_Integer aLinesNb = 0;
|
||||
Bnd_Box aBox;
|
||||
gp_Trsf aScaleTrsf;
|
||||
aScaleTrsf.SetScaleFactor (theLoc.Transformation().ScaleFactor());
|
||||
theTriangulation->MinMax (aBox, aScaleTrsf);
|
||||
return aBox.CornerMax().Z() - aBox.CornerMin().Z();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : isCylinderOrCone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean isCylinderOrCone (const TopoDS_Face& theHollowCylinder, const gp_Pnt& theLocation, gp_Dir& theDirection)
|
||||
{
|
||||
Standard_Integer aCirclesNb = 0;
|
||||
Standard_Boolean isCylinder = Standard_False;
|
||||
gp_Pnt aPos;
|
||||
|
||||
TopExp_Explorer anEdgeExp;
|
||||
for (anEdgeExp.Init (theHollowCylinder, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeExp.Current());
|
||||
BRepAdaptor_Curve anAdaptor (anEdge);
|
||||
aLinesNb++;
|
||||
|
||||
if (anAdaptor.GetType() == GeomAbs_Circle
|
||||
&& BRep_Tool::IsClosed (anEdge))
|
||||
{
|
||||
theNumCircles++;
|
||||
aCircles[theNumCircles] = anAdaptor.Circle();
|
||||
}
|
||||
else if (anAdaptor.GetType() != GeomAbs_Line || aLinesNb > 4)
|
||||
{
|
||||
theNumCircles = 0;
|
||||
return NCollection_Array1<gp_Circ>();
|
||||
}
|
||||
if (theNumCircles == 2)
|
||||
{
|
||||
break;
|
||||
aCirclesNb++;
|
||||
isCylinder = Standard_True;
|
||||
if (aCirclesNb == 2)
|
||||
{
|
||||
// Reverse the direction of the cylinder, relevant if the cylinder was created as a prism
|
||||
if (aPos.IsEqual (theLocation, Precision::Confusion()))
|
||||
{
|
||||
theDirection.Reverse();
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
aPos = anAdaptor.Circle().Location().XYZ();
|
||||
}
|
||||
}
|
||||
|
||||
return aCircles;
|
||||
return isCylinder;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -644,33 +658,29 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_
|
||||
}
|
||||
else if (Handle(Geom_ConicalSurface) aGeomCone = Handle(Geom_ConicalSurface)::DownCast (aSurf))
|
||||
{
|
||||
Standard_Size aNumCircles;
|
||||
NCollection_Array1<gp_Circ> aCircles = getCylinderCircles (theFace, aNumCircles);
|
||||
if (aNumCircles > 0 && aNumCircles < 3)
|
||||
gp_Dir aDummyDir;
|
||||
if (isCylinderOrCone (theFace, gp_Pnt(), aDummyDir))
|
||||
{
|
||||
const gp_Cone aCone = BRepAdaptor_Surface (theFace).Cone();
|
||||
const Standard_Real aRad1 = aCone.RefRadius();
|
||||
const Standard_Real aHeight = getCylinderHeight (aTriangulation, aLoc);
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
Standard_Real aRad1;
|
||||
aTrsf.SetTransformation (aCone.Position(), gp::XOY());
|
||||
|
||||
Standard_Real aRad2;
|
||||
Standard_Real aHeight;
|
||||
if (aNumCircles == 1)
|
||||
if (aRad1 == 0.0)
|
||||
{
|
||||
aRad1 = 0.0;
|
||||
aRad2 = aCircles.First().Radius();
|
||||
aHeight = aRad2 * Tan (aCone.SemiAngle());
|
||||
aTrsf.SetTransformation (aCone.Position(), gp::XOY());
|
||||
aRad2 = Tan (aCone.SemiAngle()) * aHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
aRad1 = aCircles.First().Radius();
|
||||
aRad2 = aCircles.Last().Radius();
|
||||
aHeight = aCircles.First().Location().Distance (aCircles.Last().Location());
|
||||
|
||||
const gp_Pnt aPos = aCircles.First().Location();
|
||||
const gp_Dir aDirection (aCircles.Last().Location().XYZ() - aPos.XYZ());
|
||||
|
||||
aTrsf.SetTransformation (gp_Ax3(aPos, aDirection), gp::XOY());
|
||||
const Standard_Real aTriangleHeight = (aCone.SemiAngle() > 0.0)
|
||||
? aRad1 / Tan (aCone.SemiAngle())
|
||||
: aRad1 / Tan (Abs (aCone.SemiAngle())) - aHeight;
|
||||
aRad2 = (aCone.SemiAngle() > 0.0)
|
||||
? aRad1 * (aTriangleHeight + aHeight) / aTriangleHeight
|
||||
: aRad1 * aTriangleHeight / (aTriangleHeight + aHeight);
|
||||
}
|
||||
|
||||
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad1, aRad2, aHeight, aTrsf, true);
|
||||
@@ -680,19 +690,18 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_
|
||||
}
|
||||
else if (Handle(Geom_CylindricalSurface) aGeomCyl = Handle(Geom_CylindricalSurface)::DownCast (aSurf))
|
||||
{
|
||||
Standard_Size aNumCircles;
|
||||
NCollection_Array1<gp_Circ> aCircles = getCylinderCircles (theFace, aNumCircles);
|
||||
if (aNumCircles == 2)
|
||||
{
|
||||
const gp_Cylinder aCyl = BRepAdaptor_Surface (theFace).Cylinder();
|
||||
const gp_Cylinder aCyl = BRepAdaptor_Surface (theFace).Cylinder();
|
||||
gp_Ax3 aPos = aCyl.Position();
|
||||
gp_Dir aDirection = aPos.Direction();
|
||||
|
||||
if (isCylinderOrCone (theFace, aPos.Location(), aDirection))
|
||||
{
|
||||
const Standard_Real aRad = aCyl.Radius();
|
||||
const gp_Pnt aPos = aCircles.First().Location();
|
||||
const gp_Dir aDirection (aCircles.Last().Location().XYZ() - aPos.XYZ());
|
||||
const Standard_Real aHeight = aPos.Distance (aCircles.Last().Location());
|
||||
const Standard_Real aHeight = getCylinderHeight (aTriangulation, aLoc);
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation (gp_Ax3 (aPos, aDirection), gp::XOY());
|
||||
aPos.SetDirection (aDirection);
|
||||
aTrsf.SetTransformation (aPos, gp::XOY());
|
||||
|
||||
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad, aRad, aHeight, aTrsf, true);
|
||||
theSensitiveList.Append (aSensSCyl);
|
||||
|
@@ -134,9 +134,6 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
if ( count < 2 ) isSeam = Standard_False;
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
|
||||
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
|
||||
|
||||
if (aEdge.Orientation() == TopAbs_INTERNAL ||
|
||||
aEdge.Orientation() == TopAbs_EXTERNAL ) {
|
||||
Handle(TransferBRep_ShapeMapper) errShape =
|
||||
@@ -184,7 +181,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
// ---------------------------------------
|
||||
// Translate 3D representation of the Edge
|
||||
// ---------------------------------------
|
||||
|
||||
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
|
||||
Handle(StepGeom_Curve) Gpms;
|
||||
Handle(Geom_Curve) C = CA.Curve().Curve();
|
||||
|
||||
@@ -262,6 +259,8 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Warning: TopoDSToStep_MakeStepEdge: edge without 3d curve; creating..." << std::endl;
|
||||
#endif
|
||||
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
|
||||
|
||||
if ((SA.GetType() == GeomAbs_Plane) &&
|
||||
(CA.GetType() == GeomAbs_Line)) {
|
||||
U1 = CA.FirstParameter();
|
||||
|
@@ -23,7 +23,7 @@ vori result
|
||||
|
||||
fit
|
||||
|
||||
checkprops result -l 613.39
|
||||
checkprops result -l 644.509
|
||||
checkshape result
|
||||
checksection result
|
||||
|
||||
|
@@ -23,7 +23,7 @@ vori result
|
||||
|
||||
fit
|
||||
|
||||
checkprops result -l 354.958
|
||||
checkprops result -l 386.077
|
||||
checkshape result
|
||||
checksection result
|
||||
|
||||
|
39
tests/bugs/modalg_8/bug33759
Normal file
39
tests/bugs/modalg_8/bug33759
Normal file
@@ -0,0 +1,39 @@
|
||||
puts "==========================================================="
|
||||
puts "0033759: Modeling Algorithms - Offset is in wrong direction"
|
||||
puts "==========================================================="
|
||||
puts ""
|
||||
|
||||
pload MODELING
|
||||
circle c1 0 0 0 30
|
||||
|
||||
# make and check FORWARD, NOT CLOSED edge
|
||||
mkedge e1 c1 1.5*pi 0
|
||||
wire w1 e1
|
||||
plane pln1 0 0 0 0 0 1 1 0 0
|
||||
mkface f1 pln1 w1
|
||||
openoffset of1 f1 1 7
|
||||
checkprops of1_1 -l 58.1195
|
||||
|
||||
# make and check REVERSED, NOT CLOSED edge
|
||||
complement e1
|
||||
wire w1 e1
|
||||
plane pln1 0 0 0 0 0 1 1 0 0
|
||||
mkface f1 pln1 w1
|
||||
openoffset of1 f1 1 7
|
||||
checkprops of1_1 -l 58.1195
|
||||
|
||||
# make and check FORWARD CLOSED edge
|
||||
mkedge e1 c1 0 0
|
||||
wire w1 e1
|
||||
plane pln1 0 0 0 0 0 1 1 0 0
|
||||
mkface f1 pln1 w1
|
||||
openoffset of1 f1 1 7
|
||||
checkprops of1_1 -l 232.478
|
||||
|
||||
# make and check REVERSED CLOSED edge
|
||||
complement e1
|
||||
wire w1 e1
|
||||
plane pln1 0 0 0 0 0 1 1 0 0
|
||||
mkface f1 pln1 w1
|
||||
openoffset of1 f1 1 7
|
||||
checkprops of1_1 -l 232.478
|
@@ -1,21 +0,0 @@
|
||||
puts "============"
|
||||
puts "0033664: Visualization - Selection does not work for simple shape"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
restore [locate_data_file cylinder_surface.brep] b
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vsensdis
|
||||
|
||||
vselect 200 200
|
||||
if {[vnbselected] != "1"} {
|
||||
puts "ERROR: wrong sensitive area"
|
||||
}
|
||||
|
||||
vselect 0 0
|
||||
vdump $::imagedir/${::casename}_cylinder.png
|
@@ -1,36 +0,0 @@
|
||||
puts "============"
|
||||
puts "0033664: Visualization - Selection does not work for simple shape"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
pcone c1 50 100 100
|
||||
ttranslate c1 100 0 100
|
||||
explode c1
|
||||
explode c1_1
|
||||
|
||||
pcone c2 100 50 100
|
||||
ttranslate c2 -100 0 100
|
||||
explode c2
|
||||
explode c2_1
|
||||
|
||||
pcone c3 0 100 100
|
||||
ttranslate c3 100 0 -100
|
||||
explode c3
|
||||
explode c3_1
|
||||
|
||||
pcone c4 100 0 100
|
||||
ttranslate c4 -100 0 -100
|
||||
explode c4
|
||||
explode c4_1
|
||||
|
||||
vdisplay c1_1_1 c2_1_1 c3_1_1 c4_1_1 -dispmode 1
|
||||
vsensdis
|
||||
|
||||
vfront
|
||||
vfit
|
||||
|
||||
vdump $::imagedir/${::casename}_cone.png
|
Reference in New Issue
Block a user