How can I convert implicit part to triangle mesh with python code using hwx library? (Inspire 2025)

EnesKurt
EnesKurt Altair Community Member

Hi there,

I created a body-centered cubic strut lattice using a simple cube. I want to convert this lattice structure to triangle mesh with python code. But I want to do this with the new feature “Create sharp edges and specift mesh size” option and “Average mesh size” value of 0.2 mm in Inspire 2025. I could not find the function I was looking for in the hwx library. There is a function called “convertToTriangleMesh()” but it does not allow me to enter the option and mesh size I want.

Code (without convert operation):

from hwx import inspire
model = inspire.getModel()
cube = model.createSolidBlock(x=10, y=10, z=10)
implicitPart = inspire.Implicit()
implicitPart.convertToImplicit(cube)
implicitBody = implicitPart.bodies[0]
implicitPart.strutLattice(body=implicitBody,strutDiameter=2, unitCellType='BODYCENTEREDCUBIC',uniform=False, cellSizeX=2, cellSizeY=2, cellSizeZ=2)
cube.visible = False
inspire.fitView()

image.png

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.