Images from 3D model

73 views
Skip to first unread message

Adhip

unread,
Mar 27, 2024, 6:17:44 AMMar 27
to CadQuery
Hey everyone

I was trying to get 2D images in different views of my 3D model. Is there a way Cadquery does that itself? 
Once model is created, I should be able to save image files of model viewed from different angles. 

Let me know if anyone has any suggestions or alternatives to do this.

Thanks!

Jeremy Wright

unread,
Mar 27, 2024, 11:31:23 AMMar 27
to Adhip, CadQuery
I have not added the code to change the camera position yet, but I know it is possible with VTK because I have done it before.


--
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 the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/5e493bf6-3178-48a4-88ca-eb5ee9853f42n%40googlegroups.com.
Message has been deleted

Jeremy Wright

unread,
Mar 29, 2024, 9:40:08 PMMar 29
to Adhip, CadQuery

On Fri, Mar 29, 2024, 9:38 PM Adhip <drpramod...@gmail.com> wrote:
Hello Jeremy

Thanks for sharing this. I will check it out. 
Also it is possible to create 2D drawings from models generated using Cadquery?

Message has been deleted
Message has been deleted

Jeremy Wright

unread,
Apr 4, 2024, 9:37:30 AMApr 4
to Adhip, CadQuery
I have experimented with adding dimension elements as parts in an assembly, which are then captured in the resulting DXF. I think that ezdxf, the library used by CadQuery for DXF export, also supports adding dimensions to DXFs programmatically.


On Tue, Apr 2, 2024 at 6:48 PM Adhip <drpramod...@gmail.com> wrote:
Thanks for the reply. However I can't use Cadquery to give dimensions in that DXF right? Do you know anything regarding this?

Jeremy Wright

unread,
Apr 5, 2024, 10:12:46 PMApr 5
to Joe Schroeder, CadQuery
I think the coordinate system with SVGs is Y-is-up. Have a look at the axis indicator in the screenshot in this section.




On Fri, Apr 5, 2024 at 8:31 PM Joe Schroeder <josephjs...@gmail.com> wrote:
I have found that the SVG "projectionDir" option produces strange results.

In my world, Z is up, so the top view of my model should be the XY plane. When I set "projectionDir" to (0,0,1), that's what I get:
2024-04-03 11_39_47-Main.py - Visual Studio Code.jpg

But setting it to (0,1,0) aligns the view's X axis vertically, and (1,0,0) also rotates the view 90 degrees:
2024-04-03 11_40_04-Accurex Utilities.jpg2024-04-03 11_40_08-Accurex Utilities.jpg

I'm opening the model with f3dlib, which orients the Top, Front, and Right side views correctly:

2024-04-03 11_40_25-f3d.jpg
Is there something I don't understand about "projectionDir", or is this a bug?

Thanks,

Joe

Adhip

unread,
Apr 10, 2024, 9:55:07 AMApr 10
to CadQuery
Hello Jeremy

I had one small query regarding SVG export. How do I get 1:1 viewing scale for my model if I don't specify width and height? 
I was experimenting with SVG format and I found out that if I increase the values, it may not fit within the specified dimensions. It usually exceeds it. 
If you could let me know how can I maintain 1:1 dimensions of my model after converting to SVG, that will be helpful. 

Jeremy Wright

unread,
Apr 10, 2024, 10:07:42 AMApr 10
to Adhip, CadQuery
With the way CadQuery's SVG export currently works, I don't think there is any way to ensure a 1:1 ratio without setting the width and height.


Reply all
Reply to author
Forward
0 new messages