LCOV - code coverage report
Current view: top level - src/geometry - maptriangles.jl (source / functions) Hit Total Coverage
Test: on branch nothing Lines: 0 16 0.0 %
Date: 2025-07-10 13:12:25 Functions: 0 0 -

          Line data    Source code
       1           0 : linearmap2d(g::AbstractGeometry, f::FHnd) =
       2             :     _linearmap2d(g, _istriangulation(g), f)
       3             : 
       4           0 : function linearmap2d(g::AbstractGeometry)
       5           0 :     let g = g
       6           0 :         f -> _linearmap2d(g, _istriangulation(g), f)
       7             :     end
       8             : end
       9             : 
      10             : """
      11             :     g = triangulated(geometry(mesh, x, ...))
      12             :     A = linearmap2d(g, f)
      13             : 
      14             :     fA = linearmap2d(g)
      15             :     A = fa(f)
      16             : 
      17             : Construct linear map `A` as the 2×2 matrix that maps the standard
      18             : triangle `[0,0], [1,0], [0,1]` to a 2d triangle that is congruent
      19             : (with same orientation) to `f`.
      20             : 
      21             : !!! warning "precondition"
      22             :     This method requires a triangle mesh.
      23             : 
      24             : See also [`localframe`](@ref)
      25             : """ linearmap2d
      26             : 
      27             : # _linearmap2d(g, ::IsTriangulation, f::FHnd) = _linearmap2d(rawfacebase(g, f)...)
      28             : 
      29           0 : _linearmap2d(g, ::IsTriangulation, f::FHnd) =
      30             :     _linearmap2d(position(g)[triangle(tessellation(g), f)]...)
      31             : 
      32           0 : _linearmap2d(a, b, c) = _linearmap2d(b - a, c - a)
      33             : 
      34           0 : function _linearmap2d(a::SVector{2, T}, b::SVector{2, T}) where {T}
      35           0 :     [ a b ] :: SMatrix{2, 2, T, 4}
      36             : end
      37             : 
      38           0 : function _linearmap2d(a::SVector{3, T}, b::SVector{3, T}) where {T}
      39           0 :     norma = norm(a)
      40           0 :     u = a / norma
      41           0 :     nrm = normalize(u × b)
      42           0 :     v = normalize(nrm × u) # works w/o normalize up to rounding
      43             : 
      44           0 :     a2 = SA[ norma, 0 ]
      45           0 :     b2 = SA[ dot(b, u), dot(b, v) ]
      46             : 
      47           0 :     [ a2 b2 ] :: SMatrix{2, 2, T, 4}
      48             : end
      49             : 
      50             : # TODO: linearmap3d
      51             : 
      52             : # TODO: linearmap2d from arbitrary 2d / 3d triangle (compose)

Generated by: LCOV version 1.16