sectionplanes.py — Section Planes Module

Wraps SpinFire.Scripting.API.Utilities.SectionPlaneUtilities. Controls section (cross-section / clipping) planes.

Enums

Enum

Values

Plane

YZ = 0, XZ = 1, XY = 2

PlaneAxis

X = 0, Y = 1

Functions

Function

Parameters

Returns

Description

ToggleSinglePlane()

none

None

Toggles the single section plane, which is the YZ plane.

ToggleTwoPlanes()

none

None

Toggles two section planes.

ToggleThreePlanes()

none

None

Toggles three section planes.

MoveSelectedSectionPlane(x, y, z)

x, y, z (float) — shift amounts

Error message if any, else empty

Moves the currently selected section plane.

MoveSectionPlane(plane, x, y, z)

plane (Plane); x, y, z (float)

Error message if any, else empty

Moves a specific section plane.

RotateSectionPlane(plane, axis, directedAngle)

plane (Plane); axis (PlaneAxis); directedAngle (float, degrees)

Error message if any, else empty

Rotates a section plane about an axis.

ResetSectionPlaneTransformation(plane)

plane (Plane)

Error message if any, else empty

Resets transformation for one section plane.

ResetSectionPlaneTransformations()

none

Error message if any, else empty

Resets transformations for all section planes.

GetSectionCutEdges()

none

SectionCutEdgesProfile — members CutPlaneEdges, ErrorMessage

Gets the section cut edges. Each edge prints as a list of points in model units.

ExportSectionCutProfiles(path=None)

path (str, optional)

Result message

Exports section cut profiles.

GetProjectionArea(plane=None)

plane (Plane, optional)

ProjectionAreaData — members AreaModel, Message

Gets the section cut projection area.

Behaviour Notes

Confirmed by running the Probe — Return Values script. See Classes for the full list of observed return types.

  • ToggleSinglePlane turns on YZ. With only the single plane on, every cut point had X = 0, and the XY plane stayed off. To sweep that plane, move it along X with MoveSectionPlane(sfs.Plane.YZ, dx, 0, 0).

  • Toggles flip the current state. Calling a toggle when its planes are already on switches them off. Start scripts with section planes off.

  • Errors come back as messages, not exceptions. Asking about a plane that is switched off returns a message such as The section plane with the provided index is toggled off. Toggle it on to use. For GetProjectionArea, it is in the result’s Message.

  • Still unconfirmed: which two planes ToggleTwoPlanes turns on.

Usage

1import spinfirescript as sfs
2
3sfs.ToggleTwoPlanes()
4print(sfs.MoveSectionPlane(sfs.Plane.YZ, 10, 10, 10))
5print(sfs.RotateSectionPlane(sfs.Plane.XZ, sfs.PlaneAxis.Y, 20))
6print(sfs.ResetSectionPlaneTransformation(sfs.Plane.XZ))
7sfs.GetProjectionArea(sfs.Plane.YZ)