Website: BrickSim.org
Web repo: github.com/bb1950328/BrickSimWeb
bb1950328 / bricksim Goto Github PK
View Code? Open in Web Editor NEWLDraw™ editor and simulator
Home Page: https://BrickSim.org
License: GNU General Public License v3.0
LDraw™ editor and simulator
Home Page: https://BrickSim.org
License: GNU General Public License v3.0
Website: BrickSim.org
Web repo: github.com/bb1950328/BrickSimWeb
Add an option to use high-res primitives.
Option 1: Use Assimp for maximum supported file formats.
Option 2: Use tinyobjloader and if the file is in another format the user has to convert it manually
Add a new page on the website where a human can add the release notes. It should both be readable by humans and provide a way to download them programmatically. You should be able to jump straight to a specific version with a link like bricksim.org/release-notes#v0.1.0
Add a new job to the workflow cmake_build.yml
. It should depend on all createInstaller*
and test*
jobs and only run if a new tag like v1.2.3
was created. It should download all installers and create a new release on GitHub with all installers. When the release notes already are on the website, it should add them to the mesage of the GitHub release. Otherwise it should just add a link to the release notes on the website.
Add a window to browse the LDraw Offical Model Repository and open a model in BrickSim directly.
Line in other programs, there should be a function to set the origin of the camera to the coordinates of a part. The camera should then rotate around this part.
The user should be able to create Inventories in BrickSim. A inventory is a map where the key is the combination of part number and color and the value is a quantity. An example for an Inventory in CSV format could be:
3004;1;123
3002;4;321
Which means that the part 3004
in color 1
is available 123 times and the part 3002
in color 4
is available 321 times.
The following features should be supported:
config.db
Candidates:
std::map
and std::unordered_map
tsl::robin_map
robin_hood::unordered_map
Here's a extensive benchmark of many hash maps.
Try to use a typedef
so it's easy to change the implementation and compare performance
A tool to measure various distances can be very useful. The user selects two points and BrickSim outputs the distance between them. These points can be:
Algorithm to get the point under the mouse probably will be something like:
etree::Node
under the mouse using the selection bufferLdrTriangle
s or LdrLines
or primitives like studsAnd angle or area measurement can be useful too. The possibility to restrict the measuring to one or two dimensions would be nice too (for example to measure the X difference between two points without taking Y and Z into account)
Rewrite the configuration read/write code. Things to change
The user should be able to configure several snapping distances like 5LDU, 10LDU and 20LDU. Then, he can choose one and the translation will only move in multiples of this distance.
Same with angles.
The camera should be pannable (move up/down/left/right without rotating).
There is already some code but there's a mistake somewhere in the vector math. (CadCamera::mousePan
)
LXFML is the file format of the official Lego Digital Designer (LDD). Being able to parse this format would have two main advantages:
.lxf
, which is a zip which contains one thumbnail and one .lxfml
file.Links and resources:
https://news.lugnet.com/cad/ldd/?n=140 (Message from someone from the LDD team, the linked file is also attached to this issue (lxfml.zip.file.zip))
https://www.eurobricks.com/forum/index.php?/forums/topic/92863-understanding-ldds-lxfml-schema/ (Discussion about LXFML format)
https://www.eurobricks.com/forum/index.php?/forums/topic/48239-ldd-reference/ (LDD reference thread)
Idea:
A challenge is to get the information which bricks can be replaced through which. The easiest way is hardcoding. This would work for:
Since #2 is already taking very long, I created a new issue for this.
Currently, the transform gizmo stays visible when the user drags it around. At this time, it just blocks the view of the part being moved.
So it should disappear when the user starts a transformation. When translating in one dimension, an infinite line should appear. The line has small cubes which symbolize the snapping. When translating 2D, a grid should appear. The spacing of the grid lines is like the snapping distance.
When rotating, a circle with cubes to indicate snapping angle should appear.
The color of the lines is like the axis they are (X=red, Y=green, Z=blue)
The cubes are colored like the line they are on.
Depends on #52.
basically it is important to me that BrickSim runs on as many PCs as possible. That's why I have also created 32bit builds for Linux and Windows. However these 32bit builds often cause problems, especially the windows one. That's why I decided to remove them. This is not a decision taken lightly:
There's already some code at gui::loopPartsLibraryInstallationScreen
in src/gui/gui.cpp
An ImGui window without title bar and fixed height. It should display:
Make a downloader for the Rebrickable LEGO Database and save it into cache.db
.
The schema diagram is provided. Unfortunately the links to the CSV files aren't constant so the program has to scrape the HTML to get the current links. When the links change the user can be asked if he wants to download the new files.
Before I can ship the program, I need to check for every third party lib which license they have and which text I have to include together with the program.
In the "About" window it should have a tab with all the license texts. Maybe it's required to add the text as a .txt
file in the installation so I need to configure the installers so they include that file too.
User can add another path to a .zip
or folder of unoffical parts. If the file repository doesn't find a file in the official parts library it should also look for it in the unoffical library.
These files should also automatically be included in saved .mpd
files.
Basically the title.
All actions from the user should be invoked through this component.
The user should be able to customize all keyboard shortcuts and also mouse events
Error handling currently is very inconsistent. The idea is to create two custom exception types: one which means that the current task failed and the program can safely continue and another which means that the program must exit. The controller
can display a error message when a task thread threw an exception.
When the parts library was changed (compare last modification time of directory) the file list should be reloaded. Maybe it's possible to only partially reload it to save time.
change the normals of triangle vertices when there is an optional line going through it. This should make rounded parts much smoother without increasing the triangle count.
Maybe there are other techniques to distinguish rounded edges from sharp edges...
add more sophisticated search in part palette to handle queries like title=Hello OR name=World
Basically the title
In the future, I want some buttons or other things with custom icons. All icons should be saved in individual files and then baked into one big file using a script. There are two options:
When I can create a font with all the icons and then import it into ImGui correctly, This section of the Dear ImGui docs demonstrate the usage of colorful emojis so it should work. I also want to be able to use the icons somewhere else (like in a 2d_overlay
) so there must be a possibility to get the texture ID of the ImGui font atlas and the UV coords of a specific glyph.
This is the preferred way.
Write a python script to bake all icons into one texture, generate code for their coordinates and use it like this. Only works if there's a possibility to make a ImageButton
with text and image.
Depends on #50.
Create a toolbar.
user_action
can be inserted.user_actions
The user should be able to cut, copy and paste selected elements. Currently not decided if the whole structure is serialized to clipboard or just the element ids or node paths. Serializing the whole element may enable copy/pasting to other processes of BrickSim or even other similar programs. For that I have to investigate what format other programs like stud.io, MLCad or LDCad use. But just copying the element ids is faster.
When the user copies a part of an LDraw file from a text editor, it would be useful if it can be pasted inside BrickSim. Or if a user copies a file in the file explorer it should be inserted on paste too.
The workflow file already exists, but it doesn't work and after more than 50 tries I gave up.
Basically the title. All components that can be used without too much overhead should be tested.
The ability to move a part around directly with the mouse can greatly speed up the build process.
Unfortunately, this is not very easy to implement, since the screen is only two-dimensional, but the part can be moved in three dimensions.
The code probably has to create a ray for every possible connection on the moving part and then go through the rest of the model and find the nearest matching connections
Basically the title - add a save functionality so the user can save their work to a file in the LDraw format.
The code needs to go trough the element tree and convert each element back to an ldr string.
if the user opens a file we probably need to save the order of the lines so the order is not changed and the comments are preserved.
This is just a issue to collect ideas and TODOs which aren't big enough for a dedicated issue
util::startsWith
with std::string::starts_with
, same for endsWidthldr::FileElement
subclasses instead of many single floats (use union
so scalars are still accessible directly)util.cpp
can probably be template
d (mostly functions with glm::vec
parameters)scripts
folder (except setup_workspace.sh
)e655309d7efb4
use glDrawElementsInstancedBaseInstance
which requires 4.2)glm::vec
types (this might be helpful)TriangleVertex.position
can be made vec3
and then convert to vec4
in shader (saves 14% VRAM)etree::Node
instead of one global bool elementTreeChanged
string_view
instead of substringresources.h
etree::Node::setRelativeTransformation
chmod +x
in mac installer build job like herebricksim::ldr::file_repo::FileRepo::getAllFilesOfCategory
and some related functions can return const reference instead of valueUse https://www.bricklink.com/_file/global_constants.js instead of https://www.bricklink.com/js/allVars.js
The new file has additional information like color hex codes and should be parseable easily because it's 99% json, only some js an the beginning and end.
Basically the title
Display a transform gizmo to translate and rotate things directly inside the 3D view.
The renderer has to render the meshes in layers to accomplish this.
If you change the layer of a part in the element properties, all instances but the selected disappear, (the changed instance is drawn over the other things correctly)
Depending on the resolution, the lines (type 2 and 5) are only visible if you look close enough.
glLineWidth()
is deprecated so we need a geometry shader which converts the two points into two triangles.
Performance impact should be observed and an option to disable line drawing would be nice.
It looks like open source projects can get a free InstallBuilder license. Request form is here
The question now is whether InstallBuilder is easier to configure than three separate installers (one for each OS).
As the title says, write a user manual on the website which new users can read to get to know the application. But also existing users should find information about a specific thing in this manual.
cache.db3
URLs and other info found at https://www.ldraw.org/direct-parts-access
Documentation: https://www.ldraw.org/texmap-spec.html
Mesh
already has support for textured triangle, so we just need to parse the !TEXMAP
commands and apply the texture to the geometry.
Add a new type of node to the element tree which contains the image. The user should be able to view the image, save it to a file or replace it with another file. The image file has a name and is in some kind of repository (add binary data to the file repository, there are also some image files in the offcal parts library).
The second new node type is a texture instance. Each type of texture map (Planar/Cylindrical/Spherical) is a subclass of this type. they have the required parameters (using relativeTransformation
for as many values as possible, because they can be updated through the usual instance updating process). But it seems that projecting a plane onto a cylinder or sphere isn't possible (need to do more research on that tough). So we somehow have to update the vertices. The easiest solution is to change the mesh key every time when for example the sphere radius is changed and then addToMesh
is called again. The mesh key could be something like a hash of all parameters (sphere radius+angle and image name)
make CMake invoke update_git_statistics.h
and forward the output to add_compile_definitions()
so the script doesn't have to write to the source code anymore and the GitHub Actions workflow gets obsolete.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.