Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upVarious Outline things #359
Conversation
|
|
|
Could you elaborate as to what |
| /// Draws an ellipse section with radii given in `radius` rotated by `x_axis_rotation` to 'to' in the given `direction`. | ||
| /// If `large_arc` is true, draws an arc bigger than a 180°, otherwise smaller than 180°. | ||
| /// note that `x_axis_rotation` is in radians. | ||
| pub fn push_svg_arc(&mut self, radius: Vector2F, x_axis_rotation: f32, large_arc: bool, direction: ArcDirection, to: Vector2F) { |
This comment has been minimized.
This comment has been minimized.
pcwalton
Jun 25, 2020
Collaborator
How does this compare to the arc implementation that pathfinder_canvas uses?
This comment has been minimized.
This comment has been minimized.
s3bk
Jul 6, 2020
Author
Contributor
Path2D::ellipse_section takes
- center
- axis
- start_angle
- end_angle: f32,
- direction
svg_arc takes
- last point (implicit)
- radius
- axis rotation
- large arc flag, because there are two possible circles
- destination point
| #[inline] | ||
| pub fn from_rect_rounded(rect: RectF, radius: Vector2F) -> Contour { | ||
| use std::f32::consts::SQRT_2; | ||
| const QUARTER_ARC_CP_FROM_OUTSIDE: f32 = (3.0 - 4.0 * (SQRT_2 - 1.0)) / 3.0; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
s3bk
Jul 6, 2020
Author
Contributor
It is from https://www.chartwellyorke.com/mx/explore/geometric-modeling/circle-spline-approximation.pdf
page 4. Except that I am using 1 - 4/3 (√2-1) = 3/3 - 4/3 (√2-1) = (3 - 4(√2-1))/3
The symmetry line is between the first and last point on the existing Contour. |
|
@bors-servo: r+ |
|
|
|
|
s3bk commentedJun 17, 2020
•
edited
Outline:
mergecombine two outlinestransformedvariant oftransformthat takesselfmirror_and_closeto mirror a Contour on the line between its first and last pointlenfrom_rect_roundedContour:
from_rect_rounded: SVG style rect with rounded cornerspush_svg_arc: SVG arc