Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
a96253ea
Commit
a96253ea
authored
Aug 27, 2009
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
no need for addOCCFillet in GModel
parent
9b7d3fe7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GModel.h
+0
-1
0 additions, 1 deletion
Geo/GModel.h
Geo/GModelIO_OCC.cpp
+42
-58
42 additions, 58 deletions
Geo/GModelIO_OCC.cpp
with
42 additions
and
59 deletions
Geo/GModel.h
+
0
−
1
View file @
a96253ea
...
@@ -331,7 +331,6 @@ class GModel
...
@@ -331,7 +331,6 @@ class GModel
int
writeOCCBREP
(
const
std
::
string
&
name
);
int
writeOCCBREP
(
const
std
::
string
&
name
);
int
importOCCShape
(
const
void
*
shape
);
int
importOCCShape
(
const
void
*
shape
);
int
applyOCCMeshConstraints
(
const
void
*
constraints
);
int
applyOCCMeshConstraints
(
const
void
*
constraints
);
void
addOCCFillet
(
std
::
vector
<
int
>
&
,
double
&
);
void
addShape
(
std
::
string
name
,
std
::
vector
<
double
>
&
p
,
std
::
string
op
);
void
addShape
(
std
::
string
name
,
std
::
vector
<
double
>
&
p
,
std
::
string
op
);
// Gmsh mesh file format
// Gmsh mesh file format
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO_OCC.cpp
+
42
−
58
View file @
a96253ea
...
@@ -546,9 +546,18 @@ void GModel::addShape(std::string name, std::vector<double> &p,
...
@@ -546,9 +546,18 @@ void GModel::addShape(std::string name, std::vector<double> &p,
SPoint3
(
p
[
3
],
p
[
4
],
p
[
5
]),
o
);
SPoint3
(
p
[
3
],
p
[
4
],
p
[
5
]),
o
);
}
}
else
if
(
name
==
"Fillet"
){
else
if
(
name
==
"Fillet"
){
std
::
vector
<
int
>
edges
;
if
(
p
.
size
()
<
2
){
for
(
int
i
=
0
;
i
<
p
.
size
()
-
1
;
i
++
)
edges
.
push_back
((
int
)
p
[
i
]);
Msg
::
Error
(
"At least 2 parameters have to be defined for a Fillet"
);
addOCCFillet
(
edges
,
p
[
p
.
size
()
-
1
]);
return
;
}
std
::
vector
<
TopoDS_Edge
>
edges
;
for
(
int
i
=
0
;
i
<
p
.
size
()
-
1
;
i
++
){
GEdge
*
ge
=
getEdgeByTag
((
int
)
p
[
i
]);
if
(
ge
&&
ge
->
getNativeType
()
==
GEntity
::
OpenCascadeModel
){
edges
.
push_back
(
*
(
TopoDS_Edge
*
)
ge
->
getNativePtr
());
}
}
_occ_internals
->
Fillet
(
edges
,
p
[
p
.
size
()
-
1
]);
}
}
else
{
else
{
return
;
return
;
...
@@ -560,8 +569,6 @@ void GModel::addShape(std::string name, std::vector<double> &p,
...
@@ -560,8 +569,6 @@ void GModel::addShape(std::string name, std::vector<double> &p,
catch
(
Standard_Failure
&
err
){
catch
(
Standard_Failure
&
err
){
Msg
::
Error
(
"%s"
,
err
.
GetMessageString
());
Msg
::
Error
(
"%s"
,
err
.
GetMessageString
());
}
}
}
}
TopoDS_Shape
GlueFaces
(
const
TopoDS_Shape
&
theShape
,
TopoDS_Shape
GlueFaces
(
const
TopoDS_Shape
&
theShape
,
...
@@ -612,51 +619,6 @@ TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
...
@@ -612,51 +619,6 @@ TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
// return aRes;
// return aRes;
}
}
void
OCC_Internals
::
Fillet
(
std
::
vector
<
TopoDS_Edge
>
&
edgesToFillet
,
double
Radius
){
// create a tool for fillet
BRepFilletAPI_MakeFillet
fill
(
shape
);
for
(
int
i
=
0
;
i
<
edgesToFillet
.
size
();
++
i
){
fill
.
Add
(
edgesToFillet
[
i
]);
}
for
(
int
i
=
1
;
i
<=
fill
.
NbContours
();
i
++
)
{
fill
.
SetRadius
(
Radius
,
i
,
1
);
}
fill
.
Build
();
if
(
!
fill
.
IsDone
())
{
Msg
::
Error
(
"Fillet can't be computed on the given shape with the given radius"
);
return
;
}
shape
=
fill
.
Shape
();
if
(
shape
.
IsNull
())
return
;
// Check shape validity
BRepCheck_Analyzer
ana
(
shape
,
false
);
if
(
!
ana
.
IsValid
())
{
Msg
::
Error
(
"Fillet algorithm have produced an invalid shape result"
);
}
}
void
GModel
::
addOCCFillet
(
std
::
vector
<
int
>
&
edgesToFillet
,
double
&
Radius
)
{
std
::
vector
<
TopoDS_Edge
>
toto
;
for
(
int
i
=
0
;
i
<
edgesToFillet
.
size
();
++
i
){
GEdge
*
ge
=
getEdgeByTag
(
edgesToFillet
[
i
]);
if
(
ge
&&
ge
->
getNativeType
()
==
GEntity
::
OpenCascadeModel
){
toto
.
push_back
(
*
(
TopoDS_Edge
*
)
ge
->
getNativePtr
());
}
}
_occ_internals
->
Fillet
(
toto
,
Radius
);
}
void
OCC_Internals
::
applyBooleanOperator
(
TopoDS_Shape
tool
,
const
BooleanOperator
&
op
)
void
OCC_Internals
::
applyBooleanOperator
(
TopoDS_Shape
tool
,
const
BooleanOperator
&
op
)
{
{
if
(
tool
.
IsNull
())
return
;
if
(
tool
.
IsNull
())
return
;
...
@@ -932,6 +894,33 @@ void OCC_Internals::Box(const SPoint3 &p1, const SPoint3 &p2,
...
@@ -932,6 +894,33 @@ void OCC_Internals::Box(const SPoint3 &p1, const SPoint3 &p2,
applyBooleanOperator
(
aShape
,
op
);
applyBooleanOperator
(
aShape
,
op
);
}
}
void
OCC_Internals
::
Fillet
(
std
::
vector
<
TopoDS_Edge
>
&
edgesToFillet
,
double
Radius
){
// create a tool for fillet
BRepFilletAPI_MakeFillet
fill
(
shape
);
for
(
int
i
=
0
;
i
<
edgesToFillet
.
size
();
++
i
){
fill
.
Add
(
edgesToFillet
[
i
]);
}
for
(
int
i
=
1
;
i
<=
fill
.
NbContours
();
i
++
){
fill
.
SetRadius
(
Radius
,
i
,
1
);
}
fill
.
Build
();
if
(
!
fill
.
IsDone
())
{
Msg
::
Error
(
"Fillet can't be computed on the given shape with the given radius"
);
return
;
}
shape
=
fill
.
Shape
();
if
(
shape
.
IsNull
())
return
;
// Check shape validity
BRepCheck_Analyzer
ana
(
shape
,
false
);
if
(
!
ana
.
IsValid
())
{
Msg
::
Error
(
"Fillet algorithm have produced an invalid shape result"
);
}
}
void
GModel
::
_deleteOCCInternals
()
void
GModel
::
_deleteOCCInternals
()
{
{
if
(
_occ_internals
)
delete
_occ_internals
;
if
(
_occ_internals
)
delete
_occ_internals
;
...
@@ -1198,9 +1187,4 @@ void GModel::addShape(std::string name, std::vector<double> &p,
...
@@ -1198,9 +1187,4 @@ void GModel::addShape(std::string name, std::vector<double> &p,
"Boolean Operators On Solids"
);
"Boolean Operators On Solids"
);
}
}
void
GModel
::
addOCCFillet
(
std
::
vector
<
int
>
&
,
double
&
){
Msg
::
Error
(
"Gmsh must be compiled with OpenCascade support to apply "
"the Fillet operator"
);
}
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment