Giter Site home page Giter Site logo

softbubble's Introduction

What you'll find here:
======================

* doall_QP_membrane_solver.m:
This is an example solver that moves a cube in front of the bubble and computes
the bubble's deformations.
You can change the imposed motions of the cube by modifying box_pose.m.
This is a great entry point to find out what's in this directory.

* box_pose.m: This file defines a method for the imposed motions in
doall_QP_membrane_solver.m.

* doall_generate_point_cloud_demo.m:
a demo showing how to generate point cloud data for the bubble using a picoflex
camera model.

* doall_generate_solution_and_point_cloud.m:
Given a pose X_BO of the object in the bubble frame B, this script computes
the bubble deformation and sinthetizes a point cloud with Gaussian noise.
It also FITS a mesh to the point cloud using a least squares procedure!!.

* fit_mesh_to_point_cloud.m:
this method takes a point cloud and an initial mesh. It finds a least squres
fit mesh to the point cloud using a procedure similar to the one in
Sorkine and Cohen-Or (2004) though with an actual deformation Laplacian.

* doall_constrained_LSQ_demo.m:
In this demo we:
1) Simulate the bubble's deformations given the pose of the box.
2) Simulate the point cloud given the bubble's deformations.
3) Solve for inverse problem which consists in finding the contact
   forces that cause deformations that best fit the point cloud.
4) Use the contact pressure interpolated onto the point cloud as a
   threshold to identify which points belong to the contact patch only.

* Making/using the fitter from saved data:
1) Create fitter data and save it to a file with: doall_create_and_save_fitter_data.m
   This will generate a *.mat file with all data needed to create a fitter.
2) Make use of method fit_bubble_mode.m. See example in doall_fiter.m.

Solver internals:
=================

* QP_membrane_solver_preproc:
Given the initial mesh and membrane tension T0, this preprocessing method
computes all quantities in the problem that are constant through the solution
process:
 - initial (node) mesh normals (area weighted).
 - Stiffness matrix K.
 - Aeq: Equality constraint matrix. It includes boundary conditions and
        (linearized) volume constraint. (Constraint is Aeq * u = 0).
 - node_areas: the area of each node when compute area weighted normals. This is
   computed by assembling the area of incident triangles to a node, only a third
   is assigned to each node.

* QP_membrane_solver:
Given the precomputed quantities by QP_membrane_solver_preproc plus the
definition of the box and its pose, this method computes displacement u and
returns the updated mesh positions p_WP = p_WP0 + u * normalP0_W.

Working with rigid transforms:
==============================

Utilities to create and operate 4x4 homogenous rigid transfor matrices.
These include:
- pose_inverse
- transform_point
- reexpress_vector
- rotx, roty, rotz
- MakeRpy
- MakePose


Utilities to read/write files:
==============================

* vtk_write_*: A set of utilities to write headers, unstructured meshes scalar
and vector fields. See doall_QP_membrane_solver for examples of usage.

* read_obj: reads an obj triangle mesh file.

* write_obj: writes a triangle mesh to an obj file.

Utilities to generate meshes:
=============================

You can use distmesh to make 2D meshes of circles and then rise them up to make
spherical cap meshes. See rise_bubble.

% Example: (Uniform Mesh on Unit Circle)
    fd=@(p) sqrt(sum(p.^2,2))-1;
    [p,t]=distmesh2d(fd,@huniform,0.2,[-1,-1;1,1],[]);

From: https://popersson.github.io/distmesh/

- rise_bubble: Makes a mesh for a spherical cap given the mesh for a planar
  circle mesh.
- calc_area_weighted_normals


Basic geometry queries:
=======================

- ray_to_plane
- is_inside_box: is point inside box.
- ray_to_box_inside: Ray cast from a given point only if point is insde.
  Empty result if point is outside.

softbubble's People

Contributors

amcastro-tri avatar

Watchers

James Cloos avatar  avatar

Forkers

jessicayin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.