Skip to content

Conversation

@adityamavle
Copy link

@adityamavle adityamavle commented May 7, 2023

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():

  • cookie/create: URL that creates a session (calls the sessions/create API).
  • cookie/delete: Deletes a session (calls the sessions/delete API).
  • model/input: URL inputting values (calls design/input_values).
  • model/cad: Calls the API responsible for creating the CAD file and converting it to the WebGL renderable form.
  • model/render: URL where the model is rendered using the Three.js script, which creates a scene with the model object and other background setup.

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:

chmod +x install_freecad.sh
./install_freecad.sh
  • Start the Django server by running the following command: python manage.py runserver.
  • Navigate to localhost/cookie/create to create a session (calls the sessions/create API).
  • Navigate to localhost/model/input to input values (calls design/input_values).
  • Navigate to localhost/model/cad to create the CAD file and convert it to the WebGL renderable form (calls the design/cad API).
  • Navigate to localhost/model/render to render the model using the Three.js script, which creates a scene with the model object and other background setup.
  • Optional: Navigate to localhost/cookie/delete to delete the session (calls the sessions/delete API).

suchitalad pushed a commit to suchitalad/Osdag-web that referenced this pull request Nov 18, 2025
Added Tension Member - Bolted and Tension Member - Welded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant