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

Bug: Assimp incorrectly places 3dface inserts #5422

Closed
seanth opened this issue Jan 16, 2024 · 4 comments
Closed

Bug: Assimp incorrectly places 3dface inserts #5422

seanth opened this issue Jan 16, 2024 · 4 comments
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@seanth
Copy link
Contributor

seanth commented Jan 16, 2024

Describe the bug
When viewing a dxf file consisting of two 3d faces--a base rectangle and a small sphere--Sketchup and Autodesk render the image correctly. Assimp exports stls and objs that place the sphere in a very different location

To Reproduce
Steps to reproduce the behavior:

  1. Install assimp
  2. run the command 'assimp export .dxf .stl
  3. open resulting stl
  4. see the sphere is not centered on the rectangle

Expected behavior
expected behaviour is that inserts should be inserted at the correct coordinate

Screenshots
sketchup-correct
autodesk-correct
assimp-incorrect

Platform (please complete the following information):

  • OS: Mac OS 12.6 and 13.5.1
  • Browser: not applicable
  • Version: Version 5.3 -shared -st (GIT commit 0)

Additional context
example dxf file used in the above screenshots
inputFile.dxf.zip

@seanth seanth added the Bug Global flag to mark a deviation from expected behaviour label Jan 16, 2024
@seanth
Copy link
Contributor Author

seanth commented Jan 17, 2024

After doing a lot of experimentation, I'm fairly certain that when scaling is applied to inserts, the scaling is also being applied to the positional arguments. So not only is the scale changing the xyz scale of the inserted block, it is shifting the xyz position of the block.

Edit: I'm very sure this is the issue. If I manually edit the xyz position values by dividing them by their corresponding xyz scaling values, the inserts are placed at the correct locations. This implies that somewhere there is a section of code saying pos*scale. Since the same error in placement shows up regardless of the export format, maybe the bug is in DXFLoader.cpp, but I am not very good with cpp and can't see where it might be.

@seanth
Copy link
Contributor Author

seanth commented Jan 17, 2024

I think I have resolved the issue

seanth@7c9e1d7

Changing the order of operations so placement of the inserted block happens before scaling seems to fix the problem when the position xyz values are multiplied by the scaling values.

I will test more before submitting a pull request

@seanth
Copy link
Contributor Author

seanth commented Jan 27, 2024

Fixed by #5426

@seanth seanth closed this as completed Mar 22, 2024
@seanth
Copy link
Contributor Author

seanth commented Mar 22, 2024

Fixed by #5426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
None yet
Development

No branches or pull requests

1 participant