Planar cut using Python

import XCoreModeling
import s4l_v1.model as model
block = model.CreateSolidBlock(model.Vec3(-10,-5,-10), model.Vec3(10,10,20))
XCoreModeling.PlanarCut(block, model.Vec3(0,0,0), model.Vec3(1.7,1.2,1.5))


Thanks for posting this Sylvain! I wasn't aware of the XCoreModeling API and I'd been looking for a way to implement object bending from python. This library solves that issue nicely.

You're welcome! Note, however, that functions that are not part of the s4l_v1 module are not checked for backward compatibility between Sim4Life versions and their signatures are in principle allowed to vary (although this is quite rare, in practice). It is recommended to always try to use functions under the s4l_v1 module when possible, since only these are "officially" part of the API.

This said, if you need to bend an object in Sim4Life v4.x or lower, use XCoreModeling.PlanarCut :-)

Log in to reply