add needed tangential arc params to the serializable path
This commit is contained in:
@ -1459,8 +1459,10 @@ pub enum Path {
|
||||
#[serde(flatten)]
|
||||
base: BasePath,
|
||||
/// angle range
|
||||
#[ts(type = "[number, number]")]
|
||||
angle_range: [f64; 2],
|
||||
/// center
|
||||
#[ts(type = "[number, number]")]
|
||||
center: [f64; 2],
|
||||
/// the arc's radius
|
||||
radius: f64,
|
||||
@ -1484,6 +1486,10 @@ pub enum Path {
|
||||
center: [f64; 2],
|
||||
/// arc's direction
|
||||
ccw: bool,
|
||||
/// the arc's radius
|
||||
radius: f64,
|
||||
/// the arc's angle offset
|
||||
offset: f64,
|
||||
},
|
||||
// TODO: consolidate segment enums, remove Circle. https://github.com/KittyCAD/modeling-app/issues/3940
|
||||
/// a complete arc
|
||||
|
||||
@ -1693,7 +1693,7 @@ async fn inner_tangential_arc(
|
||||
|
||||
let id = uuid::Uuid::new_v4();
|
||||
|
||||
let (center, to, ccw) = match data {
|
||||
let (center, to, ccw, radius, offset) = match data {
|
||||
TangentialArcData::RadiusAndOffset { radius, offset } => {
|
||||
// KCL stdlib types use degrees.
|
||||
let offset = Angle::from_degrees(offset);
|
||||
@ -1731,13 +1731,15 @@ async fn inner_tangential_arc(
|
||||
}),
|
||||
)
|
||||
.await?;
|
||||
(center, to.into(), ccw)
|
||||
(center, to.into(), ccw, radius, offset)
|
||||
}
|
||||
};
|
||||
|
||||
let current_path = Path::TangentialArc {
|
||||
ccw,
|
||||
center: center.into(),
|
||||
radius,
|
||||
offset: offset.to_degrees(),
|
||||
base: BasePath {
|
||||
from: from.into(),
|
||||
to,
|
||||
|
||||
Reference in New Issue
Block a user