Skip to content

Tangent inconsistency for 0 length line #971

@Tetragramm

Description

@Tetragramm

The tangent coordinates give inconsistent results for certain situations.
See the code

#import "@preview/cetz:0.4.2"

#cetz.canvas(length:1cm, {
  import cetz.draw: *
  circle((2,2), radius: 2, name:"c")
  let a = "c.0deg"
  circle(a)
  line((a,-1cm,(element:"c", point:a, solution:1)),
    (a,5cm,(element:"c", point:a, solution:1))
  )
})

Which produces

Image

Changing a to "c.10deg" produces

Image

and "c.30deg" errors with Panicked with: "No tangent solution for element c and point \"c.30deg\""

While the panic is probably the "correct" solution, the result at "c.10deg" is maybe the most convenient for drawing things.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions