-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: add subdivide support #37
Conversation
Thanks for contributing! I have a couple of questions regarding this PR:
|
Thanks for ur questions. purpose & beneficial of subdivisionsThe main purpose of subdivision is to increase the number of polygonal faces in a 3D model, it will result in smoother and more detailed rendering.
range of valuesI'm sorry, my fault, cuz prepared not enough. the value ref from https://stevinz.github.io/three-subdivide/LoopSubdivision.html My experiment results: 200kb stl (an animation mask face model) when set to 3 |
Thanks for the detailed explanation! I think this is a nice feature, lets do it, let me get back to you with a quick review later today |
- add subdivideProps interface - skip subdivide modifier when subdivide is 0
tested and docs added in 7e51754 a.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I would suggest a couple of API changes for gathering all the subdivide related parameters into the same object
see first discussion below
I have some serious concerns about the performance of the The results I am getting in the storybook example for that STL (748 Kb) in a Mac M1 PRO are:
The result are measured by just wrapping the const start = new Date().getTime()
const result = LoopSubdivision.modify(geometry, subdivide, subdivideProps)
console.log(`${subdivide} Subdivisions - elapsed LoopSubdivision.modify call time:`, new Date().getTime() - start, ' ms') I would say that the performance does not look very acceptable I am afraid... |
As the benchmarks are not giving very good results, it is possible that this change is not suitable to be merged, but I don't want to leave you empty handed, so how about this #38? |
wow, amazing, thats awesome, thats great for flexibility 👏👏 Yeah ur right, benchmarks not good, I'm sorry I forgot it 😉 I should focus on "flexibility" not one things ~ |
Closing in favor of #38, which was merged and is available under release |
cuz our package always used in the front-end part (website),
maybe show finer details through a small size stl model (optimization friendly) is needed
For example:
for my side, my website: kig.land use our package
react-stl-viewer
at index page to show models, cuz the model only need under 300kbso I add https://github.com/stevinz/three-subdivide in our package, and add params
subdivide
(<StlViewer subdivide={2} />
)But I'm not sure it's a legitimate need,
so that I create a PR, if it needed I will add more (about documention).