| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 5,652
» Latest member: Nowald
» Forum threads: 6,390
» Forum posts: 53,043
Full Statistics
|
| Online Users |
There are currently 218 online users. » 0 Member(s) | 213 Guest(s) Baidu, Bing, Facebook, Google, Yandex
|
| Latest Threads |
Looking for some Ninjago ...
Forum: Part Requests
Last Post: Philippe Hurbain
3 hours ago
» Replies: 4
» Views: 146
|
Discussion - proposal to ...
Forum: Official File Specifications/Standards
Last Post: N. W. Perry
5 hours ago
» Replies: 40
» Views: 3,041
|
Metalic gold primatives v...
Forum: Parts Authoring
Last Post: Travis Cobbs
10 hours ago
» Replies: 5
» Views: 205
|
4.5L technic axle and new...
Forum: Part Requests
Last Post: SNIPE
Yesterday, 22:45
» Replies: 2
» Views: 103
|
[LDPE] 1.8.97 Released (s...
Forum: Parts Author Tools
Last Post: Nils Schmidt
Yesterday, 19:05
» Replies: 5
» Views: 935
|
Existing Part Edit Reques...
Forum: Parts Authoring
Last Post: Chris Böhnke
Yesterday, 2:24
» Replies: 159
» Views: 388,191
|
Raven from Dreams [5272pb...
Forum: Part Requests
Last Post: Hageta
2026-02-11, 16:29
» Replies: 2
» Views: 205
|
LEGO Parts Guide - Only 3...
Forum: Part Requests
Last Post: Lisa Winter
2026-02-11, 13:04
» Replies: 35
» Views: 4,245
|
Train (RC trains) Switch ...
Forum: Part Requests
Last Post: Stephan den Ridder
2026-02-11, 9:33
» Replies: 8
» Views: 10,078
|
CMF Frog Costume Headgear...
Forum: Part Requests
Last Post: Hageta
2026-02-09, 18:38
» Replies: 2
» Views: 218
|
|
|
| Parsing LDraw |
|
Posted by: Max Murtazin - 2025-08-20, 18:04 - Forum: Help
- Replies (3)
|
 |
*sigh*
Okay, I've probably been it at it many times and probably even asked some questions on this topic before, but, alas, I'm at it again - trying to build an LDraw file format parser in C#. Why C#? Tl;dr: I need it for other stuff, and that stuff uses C#.
Well, the question itself: How does one even go around effectively parsing LDraw? This topic is a bit confusing to me due to the recursiveness (I guess that's what the word would be) of the format. My current approach is like this:
1. Read through all of the file, store all the faces in an array, store all the submodels in a separate array
2. Go through the submodel array, go to step 1 for each of them
3. Once the process is out of this recursive mess, "resolve" each submodel by applying the transform to it's triangles and adding them to the submodel's parent
4. Done, I guess?
It is very simple and doesn't account for, like, any meta or other stuff that could be important, but it should be enough for the start. I'm just not sure if this approach is good, or how it possibly could be improved
Also, I know I can read stuff like LDView source code, but I'm really bad at reading code made by other people, so it would probably take way more time than just asking it here
|
|
|
| Filepath Backslash(\) or Forwardslash(/) |
|
Posted by: Hageta - 2025-08-18, 15:16 - Forum: Parts Authoring
- Replies (6)
|
 |
All the documentation I found used backslashes(\) for filepaths e.g "s\subpart.dat". But I could not find if forward slashes(/) are also allowed. LDView can use either without any errors, while LDPe does show an error. If either both or only backslashes are allowed it should be mentioned in the Documentation either under filename or a new section. I do ask this because in ConvertToLDraw I currently use forward slashes and I got this Bug report. I will change the filepaths if they are out of spec.
|
|
|
|