MCPcopy Create free account
hub / github.com/tdewolff/canvas / Intersection

Struct Intersection

path_intersection_util.go:91–97  ·  view source on GitHub ↗

Intersection is an intersection between two path segments, e.g. Line x Line. Note that an intersection is tangent also when it is at one of the endpoints, in which case it may be tangent for this segment but may or may not cross the path depending on the adjacent segment. Notabene: for quad/cube/ell

Source from the content-addressed store, hash-verified

89// for this segment but may or may not cross the path depending on the adjacent segment.
90// Notabene: for quad/cube/ellipse aligned angles at the endpoint for non-overlapping curves are deviated slightly to correctly calculate the value for Into, and will thus not be aligned
91type Intersection struct {
92 Point // coordinate of intersection
93 T [2]float64 // position along segment [0,1]
94 Dir [2]float64 // direction at intersection [0,2*pi)
95 Tangent bool // intersection is tangent (touches) instead of secant (crosses)
96 Same bool // intersection is of two overlapping segments (tangent is also true)
97}
98
99// Into returns true if first path goes into the left-hand side of the second path,
100// i.e. the second path goes to the right-hand side of the first path.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected