Osdag web cad modelling #8
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
This pull request adds new functionalities and updates to the Osdag-web repo and associated Django web application, which is a web-based portal to design and analyze steel structures. The updates include new URL routes and views, APIs to manage sessions and convert CAD models, and a new shell script to install FreeCAD, which is a dependency for the CAD model conversion process.
Contents
The pull request contains the following updates and additions:
0. install_freecad.sh
A shell script to install FreeCAD on the user's system, which is a dependency for the file conversion from BREP to OBJ (CAD_model to WebGL_model).
1. 3D_WebGL
This directory contains the 3D CAD rendering part and the Three.js library with its content and scripts. The model_files subdirectory is used to store the file of the model to render.
2. New URLs and Views
New URL routes and views have been added to the Osdag-web/osdag/urls.py and Osdag-web/osdag/views.py files, respectively, and added to the Django project. The following templates call their respective APIs using XMLHttpRequest():
3. Update to Osdag-web/osdag/web_api/cad_model_api.py
This script is for the design/cad API, and after creation of the CAD file based on the input values in BREP format, the script converts it to WebGL format OBJ using FreeCAD macros and python.subprocess library in an asynchronous manner and stores the .obj file in the model_files directory.
4. Update to Osdag-web/osdag/web_api/sessions_api.py
The content type has been changed from multipart/form-data to application/json for ease of API calling via XMLHttpRequest.
5. Osdag-web/freecad_utils
This directory contains FreeCAD macros.
Steps to Test(Ubuntu only)
To test the updates and additions, follow the steps below:
Navigate to the Osdag-web directory:
cd Osdag-web.Set up FreeCAD by running the FreeCAD shell script using the following commands: