encima / encima/jsc3d

Zero surface normals in STL files

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
HTML
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?
1. Create any model in (for example) blender
2. Save as (binary) STL
3. View in jsc3d

What is the expected output? What do you see instead?

The object should be flat shaded - it's actually black.

What version of the product are you using? On what operating system?

Any version on any OS.

Please provide any additional information below.

The problem is that some STL exporters do not create normal vectors for each
triangle - the standard (at least according to the Wikipedia page for the STL
file format) is that the loader should test for zero length normals and compute
it's own normal from the vertex coordinates of the triangle. Worse still, the
renderer uses the normal vector to do backface culling (which is pretty
unconventional - most renderers use the vertex ordering to determine that).

```

Original issue reported on code.google.com by `SteveBak...@gmail.com` on 19 Jul 2013 at 7:18

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by creating a model in Blender, saving it as binary STL, and viewing it in jsc3d. Trace the STL loading and rendering paths to find how zero-length triangle normals affect shading and culling; done means the model is flat shaded rather than black.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.