forked from 1b-agent/opencadstudio-upstream
Merge pull request #1688 from YsDirector/pr/d3-spline-api
Create and serialize splines through automation # Conflicts: # src/app/control/entities.rs
This commit is contained in:
commit
cdf8e60fbf
3 files changed
+191
-12
No files matched your search
@@ -284,6 +284,27 @@ pub(crate) fn entity_json(e: &codec::EntityType, detail: &str) -> Value {
|
||||
map.insert("start_angle".into(), json!(a.start_angle));
|
||||
map.insert("end_angle".into(), json!(a.end_angle));
|
||||
}
|
||||
E::Spline(spline) => {
|
||||
map.insert("degree".into(), json!(spline.degree));
|
||||
map.insert("knots".into(), json!(spline.knots));
|
||||
map.insert(
|
||||
"control_points".into(),
|
||||
json!(spline
|
||||
.control_points
|
||||
.iter()
|
||||
.map(|point| v3(*point))
|
||||
.collect::<Vec<_>>()),
|
||||
);
|
||||
map.insert(
|
||||
"fit_points".into(),
|
||||
json!(spline
|
||||
.fit_points
|
||||
.iter()
|
||||
.map(|point| v3(*point))
|
||||
.collect::<Vec<_>>()),
|
||||
);
|
||||
map.insert("weights".into(), json!(spline.weights));
|
||||
}
|
||||
E::Point(p) => {
|
||||
map.insert("location".into(), v3(p.location));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user