Skip to content

Models sewing using a dxf clothing design and a dynamic avatar from an .obj file. Models tensile forces and sewing forces using OpenGL and Cuda acceleration.

License

Notifications You must be signed in to change notification settings

Mazchoo/Cuda-Accelerated-Sewing-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cuda Accelerated Sewing Simulation

Screenshot 2025-09-07 233723

Description

Python simulation of clothing model from a basic 2D pattern using and a dynamic avatar from an .obj file. Models tensile forces, gravity, collisions and sewing constraints. Runs a PyQT5 GUI for display or can render the result of each frame.

Simulation runs at approximately: 200 frames per second on a NVIDIA GeForce RTX 4050 Laptop GPU.

Work in Progress

  • Fix unwanted movement added to the system when position based contraints interact with forces
    • Remove velocity and acceleration in plane collision and/or gravity
    • Try applying Coulomb friction on collision
    • Try RMS prop and momentum for dynamic friction change, apply friction to acceleration
  • Add zooming and panning to QT widget display
  • Added ability to view and edit material properties
  • Add controls to tweak physics parameters live
  • Optimize the set-up of clothing and simulation/make a loading animation
  • Add a shader that displays normal as a color and kernels that display properties such as stress, energy, shear and bend
  • Add a pause update button and forward one frame button

Installation

  1. This project requires a machine with an nvidia GPU to run (tested with Cuda 12.8)
  2. Install a Visual Studio (Desktop development with C++) to get cl. You may need to add cl to path. Running cl in the command line should give:
usage: cl [ option... ] filename... [ /link linkoption... ]
Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34810 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
  1. Install the Cuda framework. The version of cuda must be the one that corresponds with the compiler version.
  2. Download and install pycuda (clone the repo and run pip install . in the path). The following flag must be turned on in setup.py
Switch("CUDA_ENABLE_GL", True, "Enable CUDA GL interoperability")
  1. Install the other requirements in requirements.txt in a Python enviornment.
  2. You will need to allow python to use GPU acceleration for rendering.

NVIDIA Control Panel → Manage 3D settings → Program Settings → Add python.exe → set "Preferred graphics processor" = High-performance NVIDIA processor

About

Models sewing using a dxf clothing design and a dynamic avatar from an .obj file. Models tensile forces and sewing forces using OpenGL and Cuda acceleration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages