Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
surfseg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
patmjen
surfseg
Commits
bc9dd718
Commit
bc9dd718
authored
Aug 27, 2019
by
Patrick M. Jensen
Browse files
Options
Downloads
Patches
Plain Diff
Make separate function for 4D cross product
parent
74795e65
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
surfseg/include/tet_mesh_4d.h
+2
-0
2 additions, 0 deletions
surfseg/include/tet_mesh_4d.h
surfseg/src/tet_mesh_4d.cpp
+15
-10
15 additions, 10 deletions
surfseg/src/tet_mesh_4d.cpp
with
17 additions
and
10 deletions
surfseg/include/tet_mesh_4d.h
+
2
−
0
View file @
bc9dd718
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
using
namespace
CGLA
;
using
namespace
CGLA
;
Vec4f
cross4
(
Vec4f
t
,
Vec4f
u
,
Vec4f
v
);
/** Incidence simplicial data structure for storing 3D simplicial complexes in 4D space.
/** Incidence simplicial data structure for storing 3D simplicial complexes in 4D space.
* NOTE: This code was adapted from the SimplexMesh class.
* NOTE: This code was adapted from the SimplexMesh class.
*/
*/
...
...
This diff is collapsed.
Click to expand it.
surfseg/src/tet_mesh_4d.cpp
+
15
−
10
View file @
bc9dd718
...
@@ -5,6 +5,20 @@
...
@@ -5,6 +5,20 @@
#include
"util.h"
#include
"util.h"
Vec4f
cross4
(
Vec4f
t
,
Vec4f
u
,
Vec4f
v
)
{
// See: https://math.stackexchange.com/a/2371039
float
a1
=
t
[
3
]
*
u
[
2
]
*
v
[
1
]
-
t
[
2
]
*
u
[
3
]
*
v
[
1
]
-
t
[
3
]
*
u
[
1
]
*
v
[
2
]
+
t
[
1
]
*
u
[
3
]
*
v
[
2
]
+
t
[
2
]
*
u
[
1
]
*
v
[
3
]
-
t
[
1
]
*
u
[
2
]
*
v
[
3
];
float
a2
=
-
t
[
3
]
*
u
[
2
]
*
v
[
0
]
+
t
[
2
]
*
u
[
3
]
*
v
[
0
]
+
t
[
3
]
*
u
[
0
]
*
v
[
2
]
-
t
[
0
]
*
u
[
3
]
*
v
[
2
]
-
t
[
2
]
*
u
[
0
]
*
v
[
3
]
+
t
[
0
]
*
u
[
2
]
*
v
[
3
];
float
a3
=
t
[
3
]
*
u
[
1
]
*
v
[
0
]
-
t
[
1
]
*
u
[
3
]
*
v
[
0
]
-
t
[
3
]
*
u
[
0
]
*
v
[
1
]
+
t
[
0
]
*
u
[
3
]
*
v
[
1
]
+
t
[
1
]
*
u
[
0
]
*
v
[
3
]
-
t
[
0
]
*
u
[
1
]
*
v
[
3
];
float
a4
=
-
t
[
2
]
*
u
[
1
]
*
v
[
0
]
+
t
[
1
]
*
u
[
2
]
*
v
[
0
]
+
t
[
2
]
*
u
[
0
]
*
v
[
1
]
-
t
[
0
]
*
u
[
2
]
*
v
[
1
]
-
t
[
1
]
*
u
[
0
]
*
v
[
2
]
+
t
[
0
]
*
u
[
1
]
*
v
[
2
];
return
Vec4f
(
a1
,
a2
,
a3
,
a4
);
}
TetMesh4d
::
TetMesh4d
(
const
std
::
vector
<
Vec4f
>&
vertexPositions
,
TetMesh4d
::
TetMesh4d
(
const
std
::
vector
<
Vec4f
>&
vertexPositions
,
const
std
::
vector
<
std
::
array
<
int
,
4
>>&
tetIdxs
)
const
std
::
vector
<
std
::
array
<
int
,
4
>>&
tetIdxs
)
{
{
...
@@ -341,16 +355,7 @@ Vec4f TetMesh4d::tetNormal(const Tetrahedron& tet) const
...
@@ -341,16 +355,7 @@ Vec4f TetMesh4d::tetNormal(const Tetrahedron& tet) const
Vec4f
u
=
v3
-
v1
;
Vec4f
u
=
v3
-
v1
;
Vec4f
v
=
v4
-
v1
;
Vec4f
v
=
v4
-
v1
;
// See: https://math.stackexchange.com/a/2371039
return
cross4
(
t
,
u
,
v
);
float
a1
=
t
[
3
]
*
u
[
2
]
*
v
[
1
]
-
t
[
2
]
*
u
[
3
]
*
v
[
1
]
-
t
[
3
]
*
u
[
1
]
*
v
[
2
]
+
t
[
1
]
*
u
[
3
]
*
v
[
2
]
+
t
[
2
]
*
u
[
1
]
*
v
[
3
]
-
t
[
1
]
*
u
[
2
]
*
v
[
3
];
float
a2
=
-
t
[
3
]
*
u
[
2
]
*
v
[
0
]
+
t
[
2
]
*
u
[
3
]
*
v
[
0
]
+
t
[
3
]
*
u
[
0
]
*
v
[
2
]
-
t
[
0
]
*
u
[
3
]
*
v
[
2
]
-
t
[
2
]
*
u
[
0
]
*
v
[
3
]
+
t
[
0
]
*
u
[
2
]
*
v
[
3
];
float
a3
=
t
[
3
]
*
u
[
1
]
*
v
[
0
]
-
t
[
1
]
*
u
[
3
]
*
v
[
0
]
-
t
[
3
]
*
u
[
0
]
*
v
[
1
]
+
t
[
0
]
*
u
[
3
]
*
v
[
1
]
+
t
[
1
]
*
u
[
0
]
*
v
[
3
]
-
t
[
0
]
*
u
[
1
]
*
v
[
3
];
float
a4
=
-
t
[
2
]
*
u
[
1
]
*
v
[
0
]
+
t
[
1
]
*
u
[
2
]
*
v
[
0
]
+
t
[
2
]
*
u
[
0
]
*
v
[
1
]
-
t
[
0
]
*
u
[
2
]
*
v
[
1
]
-
t
[
1
]
*
u
[
0
]
*
v
[
2
]
+
t
[
0
]
*
u
[
1
]
*
v
[
2
];
return
Vec4f
(
a1
,
a2
,
a3
,
a4
);
}
}
void
TetMesh4d
::
computeTetNormals
(
bool
normalize
)
void
TetMesh4d
::
computeTetNormals
(
bool
normalize
)
...
...
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