Skip to content

Muscle.rhomboids and Muscle.rotatorCuff have no drawable path in any body #2

Description

@elmbg-sam

Summary

Muscle.rhomboids and Muscle.rotatorCuff are public cases of the Muscle enum, but neither has a path in any of the four body path sets. Highlighting either one compiles, is accepted by every public API, and silently paints nothing.

Version: 1.6.4.

Why it is easy to hit

Both are anatomically obvious targets. I was mapping an app-level "upper back" muscle group onto the package and .rhomboids was the natural first choice — it type-checks, Muscle.allCases contains it, BodyView.highlight(.rhomboids, color: .red) returns a view, and the body simply renders unhighlighted. There is nothing at the API surface that distinguishes a drawable region from one that is not.

Reproduction

import SwiftUI
import MuscleMap

struct ContentView: View {
    var body: some View {
        HStack {
            // Renders highlighted, as expected.
            BodyView(gender: .male, side: .back)
                .highlight(.upperBack, color: .red)

            // Renders completely unhighlighted. No warning, no runtime complaint.
            BodyView(gender: .male, side: .back)
                .highlight(.rhomboids, color: .red)

            BodyView(gender: .male, side: .front)
                .highlight(.rotatorCuff, color: .red)
        }
    }
}

The same happens through heatmap(_:colorScale:) and intensities(_:colorScale:).

Confirmation from the path data

Comparing the top-level (non-sub-group) Muscle cases against the slug: values in MaleFrontPaths / MaleBackPaths at 1.6.4:

  • drawable: abs, biceps, calves, chest, deltoids, feet, forearm, gluteal, hamstring, hands, head, knees, lowerBack, obliques, quadriceps, tibialis, trapezius, triceps, upperBack
  • not drawn anywhere: rhomboids, rotatorCuff

FemaleFrontPaths / FemaleBackPaths do not contain them either.

Suggestions

Any of these would have saved the debugging time:

  1. Add paths for the two regions.
  2. Expose something queryable — e.g. Muscle.isDrawable, or BodyPathProvider-backed Muscle.regions(gender:side:) — so callers can assert their mapping at test time.
  3. Failing both, document the two cases as not-yet-drawn in the Muscle doc comment.

Happy to send a PR for (2) or (3) if you have a preference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions