export surface or face?

259 views
Skip to first unread message

joseph Flack

unread,
Oct 11, 2020, 3:33:59 AM10/11/20
to CadQuery
Hi,

I'm a big fan of python and I do a lot of work with Engineering Finite Element Analysis programs, in particular Strand7. 

Before I learn CADQuery too far, can CADquery export just surfaces or faces into IGES or STEP?

FEA is most efficient for my type of jobs using shell elements, which can easily be generated from surfaces or face geometry. I'm looking to write a script to convert a 3D solid model, for example of a car, into a "shell" model or "surface" or "face" model, so I can quickly import into Strand7 and Strand7 can then mesh it.

Thanks Joseph

Jeremy Wright

unread,
Oct 11, 2020, 7:33:35 AM10/11/20
to CadQuery
The following Python code produces a STEP file which opens fine in FreeCAD and shows just the top face. I don't know if it will work for every face/surface you'll be working with, but the base capability is there.

import cadquery as cq
from cadquery import exporters
face = cq.Workplane().box(1, 1, 1).faces(">Z")
exporters.export(face, "/home/jwright/Downloads/face_export_test.step", exporters.ExportTypes.STEP)


Adam Urbanczyk

unread,
Oct 11, 2020, 8:08:17 AM10/11/20
to CadQuery
Same is possible for shells:

s = cq.Workplane().box(1, 1, 1).shells()
s.val().exportStep('shell.step')

joseph Flack

unread,
Oct 11, 2020, 6:37:42 PM10/11/20
to Adam Urbanczyk, CadQuery
great thanks!

--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
You received this message because you are subscribed to a topic in the Google Groups "CadQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadquery/8yLstJlhMWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/44e59c31-6e22-41a7-ab8c-7c67e8406743n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages