exporting step files with color

368 views
Skip to first unread message

drshi...@gmail.com

unread,
Apr 6, 2021, 7:17:08 PM4/6/21
to CadQuery
Hi all

I noticed that the nice new Assembly feature is able to export STEP files with colors. Perhaps this is due to the use of from .occ_impl.assembly import Color and from .occ_impl.exporters.assembly import exportAssembly

I can't quite figure out how to export a basic shape to a STEP or STL files using the standard exporters

from cadquery import exporters
exporters.export(shape, 'shape.stp', exportType='STEP')  # no options for color in the arguments

Wondering if anyone has managed to export a workplane object as STEP files with color

All the best

Jon

Adam Urbanczyk

unread,
Apr 7, 2021, 2:43:30 AM4/7/21
to CadQuery
You cannot currently color cq.Workplane objects (cq.Workplane has no color property) so what you want is simply not implemented. You could construct a dummy cq.Assembly object with a single cq.Workplane and export that.

Jonathan Shimwell

unread,
Apr 7, 2021, 3:30:44 AM4/7/21
to Adam Urbanczyk, CadQuery
Nice suggestion, I shall make a dummy assembly and color then export like that. Thanks Adam.

--
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/Q9s9ggmlKYM/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/176068b1-8b20-4b71-90ce-3a9b17429d5dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages