Skip to content

Instantly share code, notes, and snippets.

View mahmouxd's full-sized avatar

Mahmoud Sadeghi mahmouxd

  • Austria
View GitHub Profile
%ASHAPE an ASLIB wrapper to compute ALPHA SHAPEs
%
% ASHAPE is a convenient wrapper for the
% ALPHA SHAPE library ASLIB
% for instructions/options see also: ASLIB
%
%SYNTAX
%-------------------------------------------------------------------------------
% P = ASHAPE(X,Y,R,OPT)
% P = ASHAPE(PO,OPT)
@mahmouxd
mahmouxd / alphavol.m
Created June 7, 2018 05:57
Alpha shape of 2D or 3D point set
function [V,S] = alphavol(X,R,fig)
%ALPHAVOL Alpha shape of 2D or 3D point set.
% V = ALPHAVOL(X,R) gives the area or volume V of the basic alpha shape
% for a 2D or 3D point set. X is a coordinate matrix of size Nx2 or Nx3.
%
% R is the probe radius with default value R = Inf. In the default case
% the basic alpha shape (or alpha hull) is the convex hull.
%
% [V,S] = ALPHAVOL(X,R) outputs a structure S with fields:
% S.tri - Triangulation of the alpha shape (Mx3 or Mx4)