Closed tampe125 closed 1 month ago
@tampe125, Has you tried to use existing camera directly?
leocad --camera "Camera 1" -w 500 -h 500 --line-width 1 -l library/ldraw -i x.png library/ldraw/parts/3001.dat
No, but I just tried and it works fine. But how can I render the piece from different angles?
EDIT
It seems to be working fine because the option is ignored since there's no Camera on .dat files :)
So it defaults to the home
view and it works "fine", but it's not the desired output.
But I also tried to use your sample LDR-file with both variants of this option, --camera-position
and --camera-position-ldraw
, and in both cases it returns the next errors (even there is a camera in the LDR-file):
Invalid parameter value(s) specified for the '--camera-position' option.
Invalid parameter value(s) specified for the '--camera-position-ldraw' option.
So, there really is a bug in LeoCAD related to how this option expected to work.
As a workaround, its possible to use Bash
+sed
+grep
for creating temporary LDR-file (on the template you provided) with setting the camera angle and for each render job (use of --camera
) just change the linked part in it.
Thank you! I was afraid I had to cobble together something like that, but at least I have a workaround
Have you tried
--camera-angles <latitude> <longitude>: Set the camera angles in degrees around the model.
Here is the help output. You may have to direct --help to a file (leocad --help > help.out
) as I don't believe output is sent to console.
Cheers,
I tried to play with the option camera-angles but I could not find the proper way, it seems everything is a little "too close".
Yep
I just retried with other options — and LeoCAD renders it as expected:
./LeoCAD*.AppImage --fov 30 --zplanes 25 5000 --camera-position-ldraw 100 400 100 0 0 0 0 0 1 -w 500 -h 500 --line-width 1 -l ./ldraw -i ./x.png ./ldraw/parts/3001.dat
Saved './x.png'.
But it still fails with you command prompt:
./LeoCAD*.AppImage --fov 30 --zplanes 25 50000 --camera-position-ldraw 202.118 -336.217 -235.106 116.154 -193.448 -88.89 -0.266364 -0.763245 0.588648 -w 500 -h 500 --line-width 1 -l ./ldraw -i ./x.png ./ldraw/parts/3001.dat
Invalid parameter value(s) specified for the '--camera-position-ldraw' option.
So, the only difference between these two command promts is values of camera coordinates.
try latest
try latest
@leozide, Just tried -- issue has been fixed.
Thanks.
This is not a bug report nor a feature request, but I could not find any better place to post this question.
I'm currently trying to use LeoCAD to render LEGO pieces from different angles and I'm using the following command:
That will correctly output a 2x4 brick in the "home" position (as well as top, bottom etc.). What I'm trying to achieve is to render the same piece from different angles, for example 45° from the bottom.
I tried to play with the option
camera-angles
but I could not find the proper way, it seems everything is a little "too close".So I decided to play with the option
camera-position
. To better understand the values, I created a dummy project with just a brick and took a look at the contents of the file:With those info I tried to run it from the CLI using this command:
But then leocad complained about the values for the
camera-position-ldraw
.Obviously I'm missing something, can I get any direction?