Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML exporter parts thumbnails cutoff #881

Open
nathaneltitane opened this issue Sep 29, 2023 · 4 comments
Open

HTML exporter parts thumbnails cutoff #881

nathaneltitane opened this issue Sep 29, 2023 · 4 comments
Labels

Comments

@nathaneltitane
Copy link

nathaneltitane commented Sep 29, 2023

Describe the bug
The parts thumbnails that are generated are being cut off, thus not showing exactly which part to use.

To Reproduce
Steps to reproduce the behavior:

  1. Open MPD model

  2. Click on Export > HTML

  3. Set arguments/settings
    image

  4. See error:

image

Expected behavior
Thumbnails should be fully rendered and proper to distinguis exact parts to use - may also need part number descriptor by it or under? (new option?)

Screenshots
See above

Version (please complete the following information):

  • OS: Debian 12 64 bit
  • LeoCAD Version continuous

N.B. Akin to bug on parts list preview where a certain thumbnail size is also cut off.

EDIT:

Added ouptut as attachment for analysis:

duel.tar.gz

@cambrialas
Copy link

Hey nathaneltitane, could you upload the MPD file ? So I can see if I get the same result.

@nathaneltitane
Copy link
Author

Hey nathaneltitane, could you upload the MPD file ? So I can see if I get the same result.

any complex mpd would do. have you tried replicating it? what is your result?

@cambrialas
Copy link

cambrialas commented Apr 23, 2024

Have tried with the same settings as you specified and with MPD file for Lego set 7740 (complex) and the result had no issues.

Have found the code for generating the HTML, but nothing is sticking out, as far i can see on Leocad version is 23.03

@cambrialas
Copy link

Hey nathaneltitane, I also found that some of my Thumbnails where not cropped correctly.

It looks like there is an error, in the code where each Thumbnail is generated and cropped. The function lcProjectPoint, is using a different coordinate system, so each point has to be modified before being projected, which made the Thumbnails to be cropped correctly.

		for (lcVector3& Point : Points)
		{
			lcVector3 mod_point(-Point.y, -Point.x, -Point.z);

			Point = lcProjectPoint(mod_point, ViewMatrix, ProjectionMatrix, Viewport);

			ExtraPixels = qMax(ExtraPixels, -Point.x);
			ExtraPixels = qMax(ExtraPixels, Point.x - ThumbnailSize);
			ExtraPixels = qMax(ExtraPixels, -Point.y);
			ExtraPixels = qMax(ExtraPixels, Point.y - ThumbnailSize);
		}

So if you have the possibility, could you try modify code in model.cpp, with the above code.

The code is located in leocad/common/lc_model.cpp around line 1466 in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants