Commit 9913e20
committed
extern: Implement support for line input in fast_obj
When the .OBJ file specifies polylines via `l` command, we now preserve
them as is. Because faces and lines can interleave, and the lines are a
comparatively rare feature, we encode these as a per-face attribute and
let the caller figure it out. When face_lines[f] is 1, instead of
treating the face as a polygon, applications should treat it as a line
strip, with each vertex being connected to the previous one.
To avoid the overhead during parsing, we lazily allocate the array when
encountering the first line, and keep them synchronized afterwards.1 parent 756c652 commit 9913e20
1 file changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
| 738 | + | |
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
799 | 810 | | |
800 | 811 | | |
801 | 812 | | |
| |||
1295 | 1306 | | |
1296 | 1307 | | |
1297 | 1308 | | |
1298 | | - | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1299 | 1325 | | |
1300 | 1326 | | |
1301 | 1327 | | |
| |||
1398 | 1424 | | |
1399 | 1425 | | |
1400 | 1426 | | |
| 1427 | + | |
1401 | 1428 | | |
1402 | 1429 | | |
1403 | 1430 | | |
| |||
1454 | 1481 | | |
1455 | 1482 | | |
1456 | 1483 | | |
| 1484 | + | |
1457 | 1485 | | |
1458 | 1486 | | |
1459 | 1487 | | |
| |||
0 commit comments