Rank: 131 based on 360 downloads (last 30 days) and 11 files submitted
photo

Sven

E-mail
Company/University
University of Michigan

Personal Profile:

Aussie living in the US. Engineering with MATLAB.

Some Interests:
-3D Volume Processing (CT, mri)
-Finite Element Analysis (human body simulation)
-Geometry Analysis (human body morphomics)

Professional Interests:
Image processing, Finite Element Analysis, Human Body Biomechanics

 

Watch this Author's files

 

Files Posted by Sven View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Jun 2013 Screenshot upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven database, insert, update 17 1
  • 4.0
4.0 | 1 rating
23 Apr 2013 Screenshot Fast morphological reconstruction of large logical masks. MATLAB's imreconstruct is slow for large 3D logical masks. bwreconstruct is a faster replacement. Author: Sven imreconstruct, bwselect, logical, reconstruction 15 0
11 Apr 2013 Screenshot stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven stl, tri, patch, mesh, data import, data export 151 25
  • 4.9
4.9 | 11 ratings
18 Mar 2013 Screenshot octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven octree, tree, volume, quadtree, stl, space 67 8
  • 5.0
5.0 | 3 ratings
12 Feb 2013 Screenshot Blended 3D poly2mask Creates a 3D mask "lofted" or "tweened" (blended smoothly) from a set of planar polygons. Author: Sven 3d mask, tween, polygon, poly2mask, loft, volume 16 0
Comments and Ratings by Sven View all
Updated File Comments Rating
14 Jun 2013 inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven

@Yan:
The problem here is just that your face normals are inconsistent. Only the bottom triangle (3rd face) is pointed IN, while the other 3 triangles are pointed OUT. If you replace:
face = [1,2,3;3,2,4;1,2,4;1,3,4];
with
face = [1,2,3;3,2,4;2,1,4;1,3,4];

and use (...,'flipnormals',true), then your input will work just fine.

25 Apr 2013 inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven

@Dun Kirk: Please send me your input points and triangles by email. This sounds like there could be something wrong and I would like to see if I can troubleshoot it.

12 Apr 2013 Growbubbles - maximum radius packing Growbubbles takes centroid points and returns the maximum radius circles or spheres without overlap Author: Sven

@CUP:
It's actually a 3D picture, it's just that by default it has no shading and is looking from the XY direction. Try this:
pts = rand(10,3) * 10 ;
growbubbles(pts)
view(3), axis image, camlight

11 Apr 2013 mesh2tri Creates regular triangulation of meshgrid data Author: Kevin Moerman

Succinct and effective.

11 Apr 2013 stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven

@JD:
The issue is that your input is "gridded data" not "triangulated data" because each of x, y, z is a 20-by-20 matrix, rather than a set of vertices and triangles.
This can be handled by stlwrite (see the help file for the "triangulation" parameter), but you'll need to understand that the default "triangulation" of gridded data is a delaunayTri of the X-Y 2D data. In this sense you have repeated X-Y pairs (one at the top of the sphere, one at the bottom). The warning you're getting comes from "delaunay", not from "stlwrite".
You can overcome this by specifying how you want your gridded data triangulated:

stlwrite('test1.stl',x,y,z,'mode','ascii','triangulation','f')

Note that you'll need "mesh2tri" from http://www.mathworks.com/matlabcentral/fileexchange/28327 for this to work. I will ask Kevin for permission to include it in stlwrite (it's a small but very handy function) for a next release.

Comments and Ratings on Sven's Files View all
Updated File Comment by Comments Rating
01 Jul 2013 inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven Scott

01 Jul 2013 inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven Scott

Is there a way to find the coordinates of face normals that are pointed in different directions? Majority of my faces are pointed in the right direction but a few are in the opposite direction. I can use 'flipnormals' but that flips every face, not just the few I need flipped. Any help is appreciated.

27 Jun 2013 stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven Ben

Very nice code and amazing fast! Thanks for sharing!

14 Jun 2013 inpolyhedron - are points inside a volume? It's inpolygon(), but for 3D triangulated surfaces. (non-convex surfaces, too!) Author: Sven Sven

@Yan:
The problem here is just that your face normals are inconsistent. Only the bottom triangle (3rd face) is pointed IN, while the other 3 triangles are pointed OUT. If you replace:
face = [1,2,3;3,2,4;1,2,4;1,3,4];
with
face = [1,2,3;3,2,4;2,1,4;1,3,4];

and use (...,'flipnormals',true), then your input will work just fine.

05 Jun 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven Harish

great utility. It would be even greater if it could handle dates as well. i.e. having a primary of dates wouldnt work in this setting

Top Tags Applied by Sven
stl, mesh, patch, volume, image processing
Files Tagged by Sven View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Jun 2013 Screenshot upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven database, insert, update 17 1
  • 4.0
4.0 | 1 rating
23 Apr 2013 Screenshot Fast morphological reconstruction of large logical masks. MATLAB's imreconstruct is slow for large 3D logical masks. bwreconstruct is a faster replacement. Author: Sven imreconstruct, bwselect, logical, reconstruction 15 0
11 Apr 2013 Screenshot stlwrite - Write binary or ascii STL file Export a variety of inputs (patch, surface) to an STL triangular mesh Author: Sven stl, tri, patch, mesh, data import, data export 151 25
  • 4.9
4.9 | 11 ratings
18 Mar 2013 Screenshot octree - partitioning 3D points into spatial subvolumes OcTree recursively splits a large set of points into smaller subvolumes. A QuadTree but in 3D. Author: Sven octree, tree, volume, quadtree, stl, space 67 8
  • 5.0
5.0 | 3 ratings
12 Feb 2013 Screenshot Blended 3D poly2mask Creates a 3D mask "lofted" or "tweened" (blended smoothly) from a set of planar polygons. Author: Sven 3d mask, tween, polygon, poly2mask, loft, volume 16 0

Contact us