Tracer (hwx.inspire.motion)#

class Tracer(self, **kwds)#

Bases: MotionObject

A point in the model that traces out a path during Motion Runs

Attribute Table#

Name

Type

animator

TraceAnimator

color

Color

enableTrail

Bool

folder

str

icon

str

location

Location

movable

bool

paper

Reference

parts

List

pen

Reference

position

property

size

int

thickness

Int

trailFrames

Int

Method Table#

Name

Description

createCurve (self, analysis)

createPolyline (self, analysis)

getDrawPoints (self, wrtPaper=True)

Get points to draw if trace lines turned on

getPoints (self, analysis, wrtPaper=False, startFrame=0)

Get tracer location at every frame of the analysis

hideTraces ()

showTraces (analysis=True, frames=(0, None), ignoreTrails=True, **kwds)

Show trace lines for all Tracers in the model. Limit what frames are

writeCsv (tracers, file, analysis=None)

Write points of all passed Tracers to a csv file

Example

from hwx import inspire
from hwx.inspire import motion

model = inspire.openTutorialFile("Motion/M01_FourBar.stmod")
link = model.getChild('Link Single Slot')

tracer = motion.Tracer(
name='Tracer 1',
pen=link.features[0],
location=link.location,
color='Red',
thickness=2
)
analysis = motion.MbdAnalysis()
analysis.analyze()
getPoints(analysis, wrtPaper=False, startFrame=0)#

Get tracer location at every frame of the analysis

wrtPaper - transform points into paper parts reference frame

getDrawPoints(wrtPaper=True)#

Get points to draw if trace lines turned on