{"id":13578613,"url":"https://github.com/mattools/matGeom","last_synced_at":"2025-04-05T19:33:25.266Z","repository":{"id":31103681,"uuid":"34662973","full_name":"mattools/matGeom","owner":"mattools","description":"Matlab geometry toolbox for 2D/3D geometric computing","archived":false,"fork":false,"pushed_at":"2025-02-11T13:25:43.000Z","size":10002,"stargazers_count":273,"open_issues_count":14,"forks_count":99,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-01T11:08:34.594Z","etag":null,"topics":["geometric-computing","geometric-shapes","geometry","geometry-library","geometry-processing","matlab","matlab-geometry-toolbox","mesh","mesh-processing","polygon"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-27T11:35:25.000Z","updated_at":"2025-02-11T13:25:46.000Z","dependencies_parsed_at":"2024-07-23T15:04:06.375Z","dependency_job_id":"218fc1e6-3f52-4e21-b736-300b0b6c4606","html_url":"https://github.com/mattools/matGeom","commit_stats":{"total_commits":955,"total_committers":22,"mean_commits":43.40909090909091,"dds":0.6324607329842932,"last_synced_commit":"b95645430e4649bd3e811b603c80b4a6a6ad4105"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattools%2FmatGeom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattools%2FmatGeom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattools%2FmatGeom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattools%2FmatGeom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattools","download_url":"https://codeload.github.com/mattools/matGeom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393095,"owners_count":20931804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geometric-computing","geometric-shapes","geometry","geometry-library","geometry-processing","matlab","matlab-geometry-toolbox","mesh","mesh-processing","polygon"],"created_at":"2024-08-01T15:01:32.242Z","updated_at":"2025-04-05T19:33:20.256Z","avatar_url":"https://github.com/mattools.png","language":"MATLAB","funding_links":[],"categories":["MATLAB","General Libraries"],"sub_categories":[],"readme":"# MatGeom\nMATLAB geometry processing library in 2D/3D.\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7799184.svg)](https://doi.org/10.5281/zenodo.5768192)\n\n**MatGeom** is a library for geometry processing / geometric computing with MATLAB in 2D and 3D. \nMatGeom is a “function-based” library: it contains several hundreds of functions for the creation,\nmanipulation and display of 2D and 3D shapes such as point sets, lines, ellipses, polygons, \n3D polygonal meshes, ...\nThe official homepage for the project is http://github.com/mattools/matGeom. \n\nA [user manual](https://github.com/mattools/matGeom/releases/download/v1.2.8/matGeom-manual-1.2.8.pdf) \ncontaining a large number of illustrations and examples is available.\nStarting from February 2022, the HTML pages of the functions (obtained with m2html) are available \n[here](https://mattools.github.io/matGeom/api/index.html).\n\nThe MatGeom library corresponds to the concatenation of the \n\"[geom2d](https://fr.mathworks.com/matlabcentral/fileexchange/7844-geom2d)\" \nand \n\"[geom3d](https://fr.mathworks.com/matlabcentral/fileexchange/24484-geom3d)\" \nlibraries that were distributed on the FileExchange. Distribution as a single library greatly \nfacilitates the interoperability of the functions.\n\nIf you use matGeom, you might cite it as follows:\n```\nDavid Legland et al. (2024) \"MatGeom library for geometric computing with MATLAB\" DOI: 10.5281/zenodo.5768192\n```\n\n## Package organization\nThe library is organized into several modules:\n* [geom2d](https://github.com/mattools/matGeom/wiki/geom2d \"geom2d Wiki page\") - General functions in Euclidean plane\n* [polygons2d](https://github.com/mattools/matGeom/wiki/polygons2d \"polygons2d Wiki page\") - Functions operating on polygons and polylines represented as list of vertices\n* [graphs](https://github.com/mattools/matGeom/wiki/graphs \"graphs Wiki page\") - Manipulation of geometric graphs\n* [geom3d](https://github.com/mattools/matGeom/wiki/geom3d \"geom3d Wiki page\") - General functions in 3D Euclidean space\n* [meshes3d](https://github.com/mattools/matGeom/wiki/meshes3d \"meshes3d Wiki page\") - Manipulation of 3D polygonal meshes (trimesh, quadmesh, or more generic meshes)\n\n## Quick overview\nBasic functionalities comprise creation of simple geometries such as points, lines, ellipses... \nAn example is provided in the following script.\n\n    % load data\n    data = load('fisheriris');\n    pts = data.meas(:, [3 1]);\n    % display\n    figure; axis equal; hold on; axis([0 8 3 9]);\n    drawPoint(pts, 'bx');\n    % Fit line\n    line = fitLine(pts);\n    drawLine(line, 'color', 'k', 'linewidth', 2);\n    % Draw oriented box\n    obox = orientedBox(pts);\n    drawOrientedBox(obox, 'color', 'k', 'linewidth', 1);\n    % identifiy species index\n    [labels, ~, inds]= unique(str.species);\n    % for ech species, compute equivalent ellipse and display with axes\n    colors = [1 0 0; 0 0.8 0; 0 0 1];\n    for i = 1:3\n        pts_i = pts(inds == i, :);\n        drawPoint(pts_i, 'marker', 'x', 'color', colors(i,:), 'linewidth', 2);\n        elli = equivalentEllipse(pts_i);\n        drawEllipse(elli, 'color', colors(i,:), 'linewidth', 2)\n        drawEllipseAxes(elli, 'color', colors(i,:), 'linewidth', 2)\n    end\n\n![Computation of equivalent ellipses, oriented box, and fitting line from set of points](https://github.com/mattools/matGeom/blob/master/docs/images/demo_geom2d_iris.png)\n\nIt is possible to work with more complex shapes such as polygonal lines (\"polylines\") or polygons.\nCommon operations comprise smoothing, simplification (retaining only a selection of vertices), \ncomputation of convex hull or of intersections with other geometric primitives. \nA summary of typical operations in presented in the following script.\n\n    % read polygon data as a numeric N-by-2 array\n    poly = load('leaf_poly.txt');\n    \n    % display the polygon using basic color option\n    figure; axis equal; hold on; axis([0 600 0 400]);\n    drawPolygon(poly, 'k');\n    \n    % Bounding box of the polygon\n    poly_bnd = boundingBox(poly);\n    drawBox(poly_bnd, 'k');\n    \n    % computes convex hull of polygon vertices\n    poly_hull = convexHull(poly);\n    drawPolygon(poly_hull, 'LineWidth', 2, 'Color', 'k');\n    \n    % applies smoothing to the original polygon.\n    poly_smooth = smoothPolygon(poly, 51);\n    drawPolygon(poly_smooth, 'color', 'b', 'linewidth', 2);\n    \n    % Computes a simplified version of the polygon\n    poly_simpl = simplifyPolygon(poly, 20);\n    drawPolygon(poly_simpl, 'color', 'r', 'linewidth', 2);\n    drawVertices(poly_simpl, 'Color', 'k', 'Marker', 's', 'MarkerFaceColor', 'w');\n    \n    % compute intersections with an arbitrary line\n    line = createLine([0 250], [600 350]);\n    drawLine(line, 'k');\n    inters = intersectLinePolygon(line, poly_simpl);\n    drawPoint(inters, 'Color', 'r', 'Marker', 'o', 'MarkerFaceColor', 'w', 'linewidth', 2);\n\n![Summary of polygon processing operations: smoothing, simplification, convex hull, intersection with lines.](https://github.com/mattools/matGeom/blob/master/docs/images/leafPoly_variousOps.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattools%2FmatGeom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattools%2FmatGeom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattools%2FmatGeom/lists"}