from hwx import inspirefrom hwx.inspire import motion
M44 = inspire.math.Matrix44model = inspire.newModel()for i in range(2): model.createSolidBlock(z=.2, position=M44(origin=(0,0,i))), model.createSolidBlock(z=.2, position=M44(origin=(0,0,i+.2)), ground=True),
cyl = model.createSolidCylinder(height=100, radius=.25)for box in model.parts: box.booleanSubtract(cyl, keepTools=True)cyl.destroy()
for hole in model.holes.aligned: inspire.Joint(hole, type='Pin', behavior='Rigid')joint1, joint2 = model.joints
motor = motion.Motor(joint2, duration=10, type='ANGLE', value=360)
coupler = motion.Coupler(entities=[joint1, motor], scales=[1,2])print('Ratio:', coupler.getRatioString())print('Do a Motion Analysis to see Block 1 spin')
for box in model.parts[::2]: corner = box.features[6] motion.Tracer(pen=corner, location=corner.location)
inspire.fitView()