Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,123
» Latest member: doron berezoviyz
» Forum threads: 6,065
» Forum posts: 51,112

Full Statistics

Online Users
There are currently 525 online users.
» 0 Member(s) | 521 Guest(s)
Applebot, Baidu, Bing, Google

Latest Threads
Simple LDCad script
Forum: LDraw Editors and Viewers
Last Post: Roland Melkert
Yesterday, 19:55
» Replies: 8
» Views: 7,866
Part request: 3757 - Mini...
Forum: Part Requests
Last Post: Paul Haan
Yesterday, 18:39
» Replies: 10
» Views: 708
7302 1x3x2/3 slope curved
Forum: Part Requests
Last Post: SNIPE
Yesterday, 16:13
» Replies: 3
» Views: 149
Updates of the Bricklink ...
Forum: Parts Authoring
Last Post: Orion Pobursky
Yesterday, 1:23
» Replies: 4
» Views: 150
MLCad.ini 2025-06 update ...
Forum: LDraw.org Announcements
Last Post: Willy Tschager
2025-06-27, 15:50
» Replies: 0
» Views: 70
sum parts
Forum: Part Requests
Last Post: Jeff Jones
2025-06-26, 19:11
» Replies: 0
» Views: 127
Friends 2014
Forum: Official Models
Last Post: Takeshi Takahashi
2025-06-26, 15:46
» Replies: 17
» Views: 14,803
part request-79898pb01
Forum: Part Requests
Last Post: Javier Orquera
2025-06-26, 13:04
» Replies: 2
» Views: 215
LDraw.org 2025-06 Parts U...
Forum: LDraw.org Announcements
Last Post: Orion Pobursky
2025-06-26, 1:49
» Replies: 0
» Views: 197
94162 Microfig Helmet wit...
Forum: Part Requests
Last Post: Allen
2025-06-25, 19:07
» Replies: 2
» Views: 203

 
  Problems with handling sharp edges
Posted by: Max Murtazin - 2023-04-10, 18:40 - Forum: Rendering Techniques - Replies (10)

So, continuing with my LDraw to xml converter grind, looks like I have managed to solve pretty much everything but one thing - handling sharp edges

I have tried multiple ways, but nothing seems to work. Generally, it seems I should not interpolating normals between faces that share sharp edge, but then arises problem of faces that share only 1 vertex. How this case should be approached?

Print this item

  Problem with transformation matrices on some parts
Posted by: Florentin - 2023-04-08, 9:07 - Forum: LDraw File Processing and Conversion - Replies (9)

Howdy!
I hope I am on the correct forum with this post Tongue
 
So I am trying to program a 3d viewer for my files for my website. And I got most stuff working, but now I noticed that when loading some parts, such as 4733 (Brick, Modified 1 x 1 with Studs on 4 Sides), two of the studs are oriented the wrong way (as you can see in the picture i uploaded): they are flipped on their axes, the other studs aren't though.
And so I looked into the ldr file of the part 4733 itself where the studs themselves are being rotated (line 116-120) and I noticed that the studs that are wrongly rotated on my viewer are the 2nd and 5th entry (line 117 and 120) there. And I looked at their transformation matrices and they seem kinda wrong.
So I looked into those matrices more and it kinda looks like the axis that those matrices flip (which is what the "-" does), should be on the other axis, so the entry in line 117 should actually be "1 16 10 10 0 0 1 0 -1 0 0 0 0 1 stud2a.dat" and in line 120 it should be "1 16 0 10 10 1 0 0 0 0 -1 0 1 0 stud2a.dat".
The matrices look like the creator of the ldr part switched up the matrix multiplication, like the flipping of the two axes and the invertion of the axis, cause if you take those matrices apart and switch them around (you flip the part where the "-" is as explained above) you end up with the correct transformation matrix.

Is it normal that those matrices are just wrong? Or do I not completely understand the ldraw standard in a way that you can't just take the vertices and transform them using those matrices?

Thanks for your help!

(I also have some problems with some of the "4-4ndis.dat" transformations in this and a few other parts, though I haven't looked into that yet, you can kinda see it on the attached picture though that the scaling in the y direction is wrong, might just be an error in my code who knows, I'll look into that )
(If I haven't explained some stuff properly feel free to ask!)
(If you want to look at the code I wrote for this: link, but it's not optimised yet and I've commented some stuff out since I work directly in the deployment branch Tongue and the zip library makes my automatic deployment fail xD)



Attached Files
.png   viewerldr.png (Size: 9.87 KB / Downloads: 81)
Print this item

Thumbs Up Part request: 26288c01 - bb0874
Posted by: Vito Tarantini - 2023-04-07, 9:15 - Forum: Part Requests - Replies (4)

Hi everyone!
I would like these two pieces to be made:

https://www.bricklink.com/v2/catalog/cat...01#T=C&C=7

https://www.bricklink.com/v2/catalog/cat...D#T=C&C=86

Thanks everyone in advance!

Print this item

  Sticker orientation for abstract patterns
Posted by: Takeshi Takahashi - 2023-04-06, 12:24 - Forum: Parts Authoring - Replies (13)

While I'm creating one of the stickers for Set 4020,
https://www.bricklink.com/v2/catalog/cat...1&#T=C&C=0
the sticker orientation issue revisited.

The issue is here:
https://library.ldraw.org/tracker/26410
* The sticker is used as a ship's plimsoll line, in portrait orientation
* The sticker is placed in landscape orientation in the sheet, only due to space limitations
* The pattern itself consists of geometrical shapes only (not font typefaces etc.) and does not have fixed orientation

As Max mentioned in the review, we need to get consensus for the orientation issue.
Which is in priority, the actual use of sticker or the placement in the sticker sheet?

Print this item

Thumbs Up Part request: 1626 - Large Figure Armor, Round, Smooth with Bar Handle - Free Ends
Posted by: Brooker - 2023-04-05, 14:55 - Forum: Part Requests - Replies (8)

Hi there, I’m new so not really sure what to do. I’m after a 3D rendering of this relatively new part: 1686
https://www.bricklink.com/v2/catalog/cat...8#T=C&C=28
https://www.brickowl.com/catalog/lego-sh...shaft-1686
Here’s a different angle that shows the detail: https://www.toypro.com/us/product/49377/...e-ends/red

I’m building a model in Studio and tried to use PartDesigner to edit the slight variation of the part that they on file but I’m not savvy enough to get it working. I’ve put in a request on the PartDesigner forum but thought I could try here too. I’m not sure how the file types work. How transferable are they from program to program?

Thanks,
Corinne

Print this item

  Need some help with code
Posted by: Max Murtazin - 2023-04-04, 19:26 - Forum: LDraw File Processing and Conversion - Replies (5)

So, I've been writing some basic LDRaw "unpacker" for some recent time, and have encountered a problem.

I'm really not sure why, but my code for transforming line type 1 makes model fall apart. It handles fine transforming all other line types, but when it comes to 1s everything breaks unless they have identity matrices for their transformations.

Checked everything, but can't find the issue. Can anybody help me with the thing?

Link to the code: https://pastebin.com/tcy91ih2

Print this item

  ldr_wgpu high performance realtime LDraw renderer
Posted by: Jonathan N - 2023-04-04, 16:13 - Forum: Rendering Techniques - Replies (8)

I've been working on an experimental renderer for LDraw files. The goal is to create a performant rendering engine targeting modern GPUs. The renderer is built on top of wgpu, which uses Vulkan, DX12, or Metal depending on the platform. These APIs are newer than OpenGL and enable access to more hardware features. This includes most devices made in the last 10 years or so. This should work in the browser eventually once WebGPU is released.


   


The framerates can easily be several times faster than existing renderers in applications like LeoCAD, Blender, LDView, etc. My desktop with an RTX 3060 only gets 1 fps (1000+ms) per frame when viewing Datsville with standard resolution primitives and no logos on studs. I get about 6-7 fps when Fully zoomed out in ldr_wgpu. Framerates shoot up to 60-120 fps when viewing a more modest area of the scene.


While the newer graphics APIs have less CPU overhead, the biggest performance improvements come from only rendering what's actually visible each frame. This is why the framerate is highly variable as the camera moves around. ldr_wgpu performs culling at the object level. Frustum culling culls any objects that are outside the camera's viewable area. Occlusion culling culls any objects that are completely obscured by other objects. While conceptually simple, occlusion culling is hard to implement efficiently. See the README on the github repository linked below and the source code for more details. The culling is calculated each frame in real time and only requires precalculating bounding boxes and bounding spheres. When zoomed out, frustum culling no longer helps. Occlusion culling can often reduce the amount of rendered geometry by 2x-3x.


There have been a number of posts about level of detail for studs and primitives. This improves performance but greatly reduces the visual quality. Thankfully, this isn't the only way to reduce the amount of vertex processing that needs to be done by the GPU. Indexed drawing can be faster than non indexed drawing but only if duplicate vertices are merged. Modern GPUs can cache vertices with the same index. This cut the vertex processing time in half when profiling on my M1 Macbook Air.


The other main topic of discussion I've seen is BFC as a performance enhancement. Whether this helps or not is highly dependent on the situation. Backface culling happens after the vertices are processed by the vertex shader. If you have a very simple pixel/fragment shader as is common in many CAD programs, there won't be much of a performance difference. I haven't been able to measure any performance difference in my testing since I'm currently just using flat shading. The processing time each frame was easily dominated by the vertex shader. I'll reassess the impact if I implement more complicated lighting and shading in the future.


The code is designed to serve as a reference for people wanting to optimize their own renderers. I've done my best to comment any techniques and link to papers and articles where appropriate. I don't have any prebuilt executables at the moment, but you can download the code from github and compile it yourself. This requires having the Rust language toolchain installed. I plan on making this into a library that people can use for their own Rust projects eventually. There are still a number of features and improvements to address like normals and more realistic shading. The github repository will be updated periodically with new techniques and insights.

https://github.com/ScanMountGoat/ldr_wgpu

   

Print this item

  PT Login and Parts with missing references
Posted by: Orion Pobursky - 2023-04-04, 15:02 - Forum: Parts Tracker Discussion - No Replies

A couple of admin items:

- I'll be troubleshooting some user's trouble with the PT logging them in based on their forum credentials. This may involve me force logging out everyone from the forums.

- I'm going to add a validation to prevent submitting a part that has missing references. Fixing these takes times away from working on important things. Parts should be submitted in a "ready to go condition" and that hasn't been happening in some cases.

Print this item

Smile An old Harry Potter Tile
Posted by: Christian Maglekær - 2023-04-04, 0:36 - Forum: Part Requests - Replies (1)

Is it possible to get this one made? 

3069pb0079 Tile 1 x 2 with Groove with Elder Futhark Runes Logogram (LEGO) Pattern

You will be amazed at what bricks you will find used in older building instructions from the LEGO Club sometimes.  Big Grin

Print this item

  Rotation axis/ point finder
Posted by: Hilbert - 2023-04-01, 17:48 - Forum: LDraw Editors and Viewers - Replies (3)

Is there a way to quickly find and select rotation axes in LDCAD?

Right now I have to manually move the selection center to the preferred position then select the right axis and rotate the part.
If I later on another day with another model use the same part again I have again manually find the right position of the selection center,
which takes some time and is very repetitive and also quite fiddly. Is there some way to save this information of where the rotation axis is?
Especially for "natural" / "real life rotation axes" it would be convenient if there was a move selection center to rotation axis option (if selection is a single part).

"natural rotation axis" would be e.g. the connection (axis) of a hinge.


standard selection center (and rotation axes)
[Image: U5CJl.jpg]

moved selection center to "natural rotation axis"
[Image: U5Ir3.jpg]

Also what is the best and quickest way to do this if the selection is a submodel ?
I know I can again move the selection center manually - but most of the time I actually want to rotate the whole submodel
around the "natural rotation axis" of a part of the submodel.
I would like to set the selection center of the sub model just by clicking on that part (in nested mode? ) and then choose set to rotation axis and
then the selection center of that part becomes a selection center of the whole sub model and also setting the grid in the right way so choosing the part/submodel rotate option
rotates around the right axis-  in the main model space.

I wonder if a macro/script would be able to do this and if that could become fully part of LDCAD.

Because currently it takes way to long for me to rotate parts around commonly used axis (what I call "natural rotation axes")
and also whole groups/submodels/multiple bricks selections.

I hope it is understandable what I want.

Print this item