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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
dda491ef
Commit
dda491ef
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
0e49772a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GEdge.cpp
+4
-5
4 additions, 5 deletions
Geo/GEdge.cpp
Geo/GFace.cpp
+16
-26
16 additions, 26 deletions
Geo/GFace.cpp
with
20 additions
and
31 deletions
Geo/GEdge.cpp
+
4
−
5
View file @
dda491ef
// $Id: GEdge.cpp,v 1.3
3
2008-01-2
0 10:10:41
geuzaine Exp $
// $Id: GEdge.cpp,v 1.3
4
2008-01-2
1 22:16:04
geuzaine Exp $
//
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -73,7 +73,7 @@ SBoundingBox3d GEdge::bounds() const
...
@@ -73,7 +73,7 @@ SBoundingBox3d GEdge::bounds() const
if
(
geomType
()
!=
DiscreteCurve
&&
geomType
()
!=
BoundaryLayerCurve
){
if
(
geomType
()
!=
DiscreteCurve
&&
geomType
()
!=
BoundaryLayerCurve
){
const
int
N
=
10
;
const
int
N
=
10
;
for
(
int
i
=
0
;
i
<
N
;
i
++
){
for
(
int
i
=
0
;
i
<
N
;
i
++
){
double
t
=
tr
.
low
()
+
(
double
)
i
/
(
double
)(
N
-
1
)
*
(
tr
.
high
()
-
tr
.
low
());
double
t
=
tr
.
low
()
+
(
double
)
i
/
(
double
)(
N
-
1
)
*
(
tr
.
high
()
-
tr
.
low
());
GPoint
p
=
point
(
t
);
GPoint
p
=
point
(
t
);
bbox
+=
SPoint3
(
p
.
x
(),
p
.
y
(),
p
.
z
());
bbox
+=
SPoint3
(
p
.
x
(),
p
.
y
(),
p
.
z
());
}
}
...
@@ -139,8 +139,8 @@ double GEdge::curvature(double par) const
...
@@ -139,8 +139,8 @@ double GEdge::curvature(double par) const
double
eps2
=
1.e-5
;
double
eps2
=
1.e-5
;
Range
<
double
>
r
=
parBounds
(
0
);
Range
<
double
>
r
=
parBounds
(
0
);
if
(
r
.
low
()
==
par
)
eps2
=
0
;
if
(
r
.
low
()
==
par
)
eps2
=
0
;
if
(
r
.
high
()
==
par
)
eps1
=
0
;
if
(
r
.
high
()
==
par
)
eps1
=
0
;
SVector3
n1
=
firstDer
(
par
-
eps1
);
SVector3
n1
=
firstDer
(
par
-
eps1
);
SVector3
n2
=
firstDer
(
par
+
eps2
);
SVector3
n2
=
firstDer
(
par
+
eps2
);
...
@@ -158,4 +158,3 @@ double GEdge::curvature(double par) const
...
@@ -158,4 +158,3 @@ double GEdge::curvature(double par) const
SVector3
d
=
one_over_D
*
(
n2
-
n1
);
SVector3
d
=
one_over_D
*
(
n2
-
n1
);
return
norm
(
d
);
return
norm
(
d
);
}
}
This diff is collapsed.
Click to expand it.
Geo/GFace.cpp
+
16
−
26
View file @
dda491ef
// $Id: GFace.cpp,v 1.4
0
2008-01-1
9
22:
0
6:0
1
geuzaine Exp $
// $Id: GFace.cpp,v 1.4
1
2008-01-
2
1 22:
1
6:0
4
geuzaine Exp $
//
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -276,7 +276,7 @@ void GFace::computeMeanPlane(const std::vector<SPoint3> &points)
...
@@ -276,7 +276,7 @@ void GFace::computeMeanPlane(const std::vector<SPoint3> &points)
double
ex
[
3
],
t1
[
3
],
t2
[
3
];
double
ex
[
3
],
t1
[
3
],
t2
[
3
];
// check coherence of results for non-plane surfaces
// check coherence of results for non-plane surfaces
if
(
geomType
()
!=
GEntity
::
Plane
&&
geomType
()
!=
GEntity
::
DiscreteSurface
)
{
if
(
geomType
()
!=
Plane
&&
geomType
()
!=
DiscreteSurface
)
{
double
res2
[
3
],
c
[
3
],
cosc
,
sinc
,
angplan
;
double
res2
[
3
],
c
[
3
],
cosc
,
sinc
,
angplan
;
double
eps
=
1.e-3
;
double
eps
=
1.e-3
;
...
@@ -362,7 +362,7 @@ end:
...
@@ -362,7 +362,7 @@ end:
meanPlane
.
x
,
meanPlane
.
y
,
meanPlane
.
z
);
meanPlane
.
x
,
meanPlane
.
y
,
meanPlane
.
z
);
//check coherence for plane surfaces
//check coherence for plane surfaces
if
(
geomType
()
==
GEntity
::
Plane
)
{
if
(
geomType
()
==
Plane
)
{
SBoundingBox3d
bb
=
bounds
();
SBoundingBox3d
bb
=
bounds
();
double
lc
=
norm
(
SVector3
(
bb
.
max
(),
bb
.
min
()));
double
lc
=
norm
(
SVector3
(
bb
.
max
(),
bb
.
min
()));
std
::
list
<
GVertex
*>
verts
=
vertices
();
std
::
list
<
GVertex
*>
verts
=
vertices
();
...
@@ -405,7 +405,7 @@ void GFace::getMeanPlaneData(double plan[3][3]) const
...
@@ -405,7 +405,7 @@ void GFace::getMeanPlaneData(double plan[3][3]) const
double
GFace
::
curvature
(
const
SPoint2
&
param
)
const
double
GFace
::
curvature
(
const
SPoint2
&
param
)
const
{
{
if
(
geomType
()
==
Plane
)
return
0
;
if
(
geomType
()
==
Plane
)
return
0
;
// X=X(u,v) Y=Y(u,v) Z=Z(u,v)
// X=X(u,v) Y=Y(u,v) Z=Z(u,v)
// curv = div n = dnx/dx + dny/dy + dnz/dz
// curv = div n = dnx/dx + dny/dy + dnz/dz
...
@@ -413,30 +413,30 @@ double GFace::curvature (const SPoint2 ¶m) const
...
@@ -413,30 +413,30 @@ double GFace::curvature (const SPoint2 ¶m) const
const
double
eps
=
1.e-3
;
const
double
eps
=
1.e-3
;
Pair
<
SVector3
,
SVector3
>
der
=
firstDer
(
param
)
;
Pair
<
SVector3
,
SVector3
>
der
=
firstDer
(
param
);
SVector3
du
=
der
.
first
();
SVector3
du
=
der
.
first
();
SVector3
dv
=
der
.
second
();
SVector3
dv
=
der
.
second
();
SVector3
nml
=
crossprod
(
du
,
dv
);
SVector3
nml
=
crossprod
(
du
,
dv
);
double
detJ
=
norm
(
nml
);
double
detJ
=
norm
(
nml
);
du
.
normalize
();
du
.
normalize
();
dv
.
normalize
();
dv
.
normalize
();
SVector3
n1
=
normal
(
SPoint2
(
param
.
x
()
-
eps
,
param
.
y
()
))
;
SVector3
n1
=
normal
(
SPoint2
(
param
.
x
()
-
eps
,
param
.
y
()));
SVector3
n2
=
normal
(
SPoint2
(
param
.
x
()
+
eps
,
param
.
y
()
))
;
SVector3
n2
=
normal
(
SPoint2
(
param
.
x
()
+
eps
,
param
.
y
()));
SVector3
n3
=
normal
(
SPoint2
(
param
.
x
()
,
param
.
y
()
-
eps
))
;
SVector3
n3
=
normal
(
SPoint2
(
param
.
x
()
,
param
.
y
()
-
eps
));
SVector3
n4
=
normal
(
SPoint2
(
param
.
x
()
,
param
.
y
()
+
eps
))
;
SVector3
n4
=
normal
(
SPoint2
(
param
.
x
()
,
param
.
y
()
+
eps
));
SVector3
dndu
=
500
*
(
n2
-
n1
);
SVector3
dndu
=
500
*
(
n2
-
n1
);
SVector3
dndv
=
500
*
(
n4
-
n3
);
SVector3
dndv
=
500
*
(
n4
-
n3
);
double
c
=
fabs
(
dot
(
dndu
,
du
)
+
dot
(
dndv
,
dv
))
/
detJ
;
double
c
=
fabs
(
dot
(
dndu
,
du
)
+
dot
(
dndv
,
dv
))
/
detJ
;
//
Msg
(INFO,"c = %g detJ %g",c,detJ);
// Msg(INFO,
"c = %g detJ %g",
c,
detJ);
return
c
;
return
c
;
}
}
void
GFace
::
XYZtoUV
(
const
double
X
,
const
double
Y
,
const
double
Z
,
void
GFace
::
XYZtoUV
(
const
double
X
,
const
double
Y
,
const
double
Z
,
...
@@ -483,12 +483,6 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
...
@@ -483,12 +483,6 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
mat
[
1
][
0
]
=
der
.
right
().
x
();
mat
[
1
][
0
]
=
der
.
right
().
x
();
mat
[
1
][
1
]
=
der
.
right
().
y
();
mat
[
1
][
1
]
=
der
.
right
().
y
();
mat
[
1
][
2
]
=
der
.
right
().
z
();
mat
[
1
][
2
]
=
der
.
right
().
z
();
// printf("X = %g Y = %g Z = %g U %g V %g deru = %g %g %g derv = %g %g %g\n",P.x(),P.y(),P.z(),U,V
// ,der.left().x(),der.left().y(),der.left().z()
// ,der.right().x(),der.right().y(),der.right().z());
// getchar();
mat
[
2
][
0
]
=
0.
;
mat
[
2
][
0
]
=
0.
;
mat
[
2
][
1
]
=
0.
;
mat
[
2
][
1
]
=
0.
;
mat
[
2
][
2
]
=
0.
;
mat
[
2
][
2
]
=
0.
;
...
@@ -527,13 +521,10 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
...
@@ -527,13 +521,10 @@ void GFace::XYZtoUV(const double X, const double Y, const double Z,
}
}
}
}
SPoint2
GFace
::
parFromPoint
(
const
SPoint3
&
p
)
const
SPoint2
GFace
::
parFromPoint
(
const
SPoint3
&
p
)
const
{
{
double
U
,
V
;
double
U
,
V
;
XYZtoUV
(
p
.
x
(),
p
.
y
(),
p
.
z
(),
U
,
V
,
1.0
);
XYZtoUV
(
p
.
x
(),
p
.
y
(),
p
.
z
(),
U
,
V
,
1.0
);
return
SPoint2
(
U
,
V
);
return
SPoint2
(
U
,
V
);
}
}
...
@@ -563,5 +554,4 @@ void GFace::computeGraphicsRep(int nu, int nv)
...
@@ -563,5 +554,4 @@ void GFace::computeGraphicsRep(int nu, int nv)
_graphicsRep
[
i
][
j
]
=
gp
;
_graphicsRep
[
i
][
j
]
=
gp
;
}
}
}
}
}
}
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