TransWikia.com

Export Discretized ImplicitRegion as step using OpenCascade

Mathematica Asked by DrBubbles on January 27, 2021

Following the reply by @user21 to this post on exporting a region to a step file, I tried to do the same for a Discretized ImplicitRegion, but OpenCascadeShape didn’t appear to work. Is there a switch or a constraint I need to apply to Discretized regions to allow OpenCascadeShape to handle them?

imReg = ImplicitRegion[x^2 + y^2 - z < 0, {x, y, z}];
discReg = DiscretizeRegion[imReg, {{-2, 2}, {-2, 2}, {0, 5}}]

discReg

Needs["OpenCascadeLink`"]
shape = OpenCascadeShape[discReg]

output

OpenCascadeShapeExport["~/shape.step", shape]

export output

One Answer

Try using ToBoundaryMesh like so:

Needs["NDSolve`FEM`"];
Needs["OpenCascadeLink`"]
imReg = ImplicitRegion[x^2 + y^2 - z < 0, {{x, -2, 2}, {y, -2, 2}, {z, 0, 5}}];
bmesh = ToBoundaryMesh[imReg];
bmesh["Wireframe"]
shape = OpenCascadeShape[bmesh]
OpenCascadeShapeExport["~/shape.stp", shape]

The shape can now be read in by external packages such as SolidWorks.

enter image description here

Correct answer by Tim Laska on January 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP