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

can you give me the gemini-viewer.esm.min.js orginal code? #119

Open
dotoritos-kim opened this issue Nov 3, 2023 · 5 comments
Open

can you give me the gemini-viewer.esm.min.js orginal code? #119

dotoritos-kim opened this issue Nov 3, 2023 · 5 comments

Comments

@dotoritos-kim
Copy link

dotoritos-kim commented Nov 3, 2023

How did you implement SolidHatch in DxfViewer?

I am amazed at the incredible performance.

I'm curious as to whether you did the triangulation separately or used another method.

I want to see the entire dxfviewer part. I am also a vargan/dxf-viewer contributor.

@yanzexuan1
Copy link
Collaborator

Oh, thank you in the first place, because this project rely on dxf-viewer.

A solid hatch is a THREE.Mesh with color.

Performance is a big topic, we did much work to increase it, including merging objects/materials, instancing, bvh, simplify polygons, etc.

@dotoritos-kim
Copy link
Author

dotoritos-kim commented Nov 4, 2023

When I gave you an example file, can you tell me what algorithms spline, solid hatch, and hatch work and how they work?
Sorry if I was so rude.

@yanzexuan1
Copy link
Collaborator

Np. Are you gonna share a example file, please go ahead. I'll try my best to tell everything you interested, I may not be able to share lots of code at this time.

For spline, we tried to generate a line that is no really accurate, otherwise, there are too many points. And we'll try to merge splines with the same color, layer, etc.

We also merge hatches if they have the same color, layer, etc.

@dotoritos-kim
Copy link
Author

spline, hatch extream size example

I am curious about how a file containing splines and hatches of this large size is rendered. I want to know the overall flow and algorithm used.

@yanzexuan1
Copy link
Collaborator

Ok, I opened the example filess, as we can see, there are about 715 entities, mostly are splines and hatches (and of course, some of them are in inserts). This is not a big number, but it contains complex splines and hatches.
image

We defined a function drawSpline(), for spline entity, we can get these:

For hatch, there is drawHatch() function. we get:

  • hatchEntity.boundaryPaths
  • boundaryPath.edges
    Then build hatch geometry by a number of hatch boundaries.

Hope it help.

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

No branches or pull requests

2 participants