Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS 419 Final Project
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xuyangt3
CS 419 Final Project
Commits
7812f223
Commit
7812f223
authored
3 years ago
by
xuyangt3
Browse files
Options
Downloads
Patches
Plain Diff
todo generate mesh from evaluation, reuse x and y
parent
82ab0791
No related branches found
No related tags found
1 merge request
!1
Temp eval bezier
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Bezier.cpp
+54
-0
54 additions, 0 deletions
src/Bezier.cpp
with
54 additions
and
0 deletions
src/Bezier.cpp
0 → 100644
+
54
−
0
View file @
7812f223
#include
"Project.h"
using
Eigen
::
Matrix4d
;
using
Eigen
::
Vector4d
;
using
Eigen
::
MatrixXd
;
using
Eigen
::
Matrix
;
Matrix4d
subdivideWeights
=
(
Matrix4d
()
<<
1.
,
0.
,
0.
,
0.
,
0.5
,
0.5
,
0.
,
0.
,
0.25
,
0.5
,
0.25
,
0.
,
0.125
,
0.375
,
0.375
,
0.125
).
finished
();
Matrix4d
basisWeights
=
(
Matrix4d
()
<<
-
1
,
3
,
-
3
,
1
,
3
,
-
6
,
3
,
0
,
-
3
,
3
,
0
,
0
,
1
,
0
,
0
,
0
).
finished
();
Vec
eval
(
double
x
,
double
y
,
Matrix
<
double
,
3
,
16
>
ctrlPts
)
{
Vector4d
xCoeff
=
basisWeights
*
Vector4d
(
x
*
x
*
x
,
x
*
x
,
x
,
1
);
Vector4d
yCoeff
=
basisWeights
*
Vector4d
(
y
*
y
*
y
,
y
*
y
,
y
,
1
);
MatrixXd
faceCoeff
=
xCoeff
.
replicate
<
1
,
4
>
()
*
yCoeff
.
asDiagonal
();
faceCoeff
.
resize
(
16
,
1
);
// cout << faceCoeff;
return
ctrlPts
*
faceCoeff
;
}
int
main
(){
cout
<<
subdivideWeights
.
reverse
()
<<
endl
;
Matrix
<
double
,
3
,
16
>
points
;
points
.
col
(
0
)
<<
0
,
0
,
1
;
points
.
col
(
1
)
<<
1
,
0
,
50
;
points
.
col
(
2
)
<<
2
,
0
,
3
;
points
.
col
(
3
)
<<
3
,
0
,
0
;
points
.
col
(
4
)
<<
0
,
1
,
2
;
points
.
col
(
5
)
<<
1
,
1
,
1
;
points
.
col
(
6
)
<<
2
,
1
,
3
;
points
.
col
(
7
)
<<
3
,
1
,
1
;
points
.
col
(
8
)
<<
0
,
2
,
1
;
points
.
col
(
9
)
<<
1
,
2
,
4
;
points
.
col
(
10
)
<<
2
,
2
,
9
;
points
.
col
(
11
)
<<
3
,
2
,
16
;
points
.
col
(
12
)
<<
0
,
3
,
3
;
points
.
col
(
13
)
<<
1
,
3
,
0
;
points
.
col
(
14
)
<<
2
,
3
,
0
;
points
.
col
(
15
)
<<
3
,
3
,
30
;
cout
<<
eval
(
0.2
,
0.3
,
points
);
cout
<<
eval
(
0.3
,
0.2
,
points
);
}
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