<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: -",
    "macOS: 15.4.0 -",
    "tvOS: 18.4.0 -",
    "visionOS: 2.4.0 -",
    "watchOS: 11.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "hvf",
  "identifier" : "/documentation/hvf/PartRenderer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "hvf"
    ],
    "preciseIdentifier" : "s:3hvf12PartRendererC"
  },
  "title" : "PartRenderer"
}
-->

# PartRenderer

An object that can be used to set parameters for rendering a part, to render the part, and to diagnose the results of rendering

```
class PartRenderer
```

## Topics

### Classes

[`class AxisValues`](/documentation/hvf/PartRenderer/AxisValues)

All the axis values applied to a part. The index is the axis number (determined by the loader).
Axis values are in design space (-1.0…1.0)

[`class PartParameters`](/documentation/hvf/PartRenderer/PartParameters)

All the parameters applied to a part, including nested subparts

### Structures

[`struct Point`](/documentation/hvf/PartRenderer/Point)

A point returned from the scaler

[`struct Subparts`](/documentation/hvf/PartRenderer/Subparts)

Collection of part parameters for the subparts of a part. The index is the subpart number (determined by the loader)

[`struct Translation`](/documentation/hvf/PartRenderer/Translation)

A translation applied to a subpart

### Initializers

[`init(custom: CustomPartLoader, reusable: Bool)`](/documentation/hvf/PartRenderer/init(custom:reusable:))

Use a custom, client-defined loader
Setting reusable to true preserves the input parameter values when rendering; otherwise they are destroyed by rendering

[`init(hvglLoader: HVGLPartLoader, reusable: Bool)`](/documentation/hvf/PartRenderer/init(hvglLoader:reusable:))

Use a loader specific to an HVGL table in memory
Setting reusable to true preserves the input parameter values when rendering; otherwise they are destroyed by rendering

### Instance Properties

[`var blendedAxisValueBounds: ClosedRange<Double>`](/documentation/hvf/PartRenderer/blendedAxisValueBounds)

After rendering, returns the maximum and minimum blended values set on any axis in the part’s tree
This is useful for detecting axes going out of range (-1.0…1.0)

[`var parameters: PartRenderer.PartParameters`](/documentation/hvf/PartRenderer/parameters)

Parameters that control how the part is rendered. The default is to set all axes, rotations, translations, etc. to zero

[`var partAxisCount: Int`](/documentation/hvf/PartRenderer/partAxisCount)

The number of axes of the current part; zero if no part set

[`var partIndex: Int`](/documentation/hvf/PartRenderer/partIndex)

The unique identifier of the part to be rendered. Setting this
resets the parameters property to default values (an empty part parameter tree).
Any previously captured PartParameters or AxisValues are invalid.

### Instance Methods

[`func clearPartCache()`](/documentation/hvf/PartRenderer/clearPartCache())

Clear the cache of loaded parts. This only happens when this function is called.

[`func render(to: (PartRenderer.Instruction) -> PartRenderer.Action) -> Bool`](/documentation/hvf/PartRenderer/render(to:))

Render the current part using the current parameters using the supplied render context
If the PartRenderer was created using reusable, all input parameters are intact afterwards; otherwise they are destroyed
Returns true if rendering was successful

### Enumerations

[`enum Action`](/documentation/hvf/PartRenderer/Action)

Action requested by the render context after processing an instruction

[`enum Instruction`](/documentation/hvf/PartRenderer/Instruction)

The set of instructions passed to a render context

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)