For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Creation of empty shape?

Joe Pfeiffer's picture
Forums: 

I'm creating a grid of columns (support structures for a 3D print); the obvious way to do it would be with a pair of nested for-loops adding to an initially-empty shape -- what I'd like to do would look something like this (in PythonOCC):

supportPillars = TopoDS_Shape()
for j in range(-maxj, -minj) + range(minj, maxj+1) :
    for k in xrange(-maxk, maxk + 1) :
        axis = gp_Ax2(gp_Pnt(-supportHt,
                             j*supportSpace, k*supportSpace),
                      gp_DX())
        pillar = BRepPrimAPI_MakeCylinder(axis, supportPillarRad, supportHt - caseThick).Shape()
        supportPillars = BRepAlgoAPI_Fuse(supportPillars, pillar).Shape()

Of course this doesn't work; when I try it I get a 

RuntimeError: StdFail_NotDone

My current workaround is to just catch the exception and use the first pillar created as a seed for the supportPillars.  It seems like there ought to be a more elegant way to do this; is there?