Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 39b13612ebd645a65eda854771b517371f2f858a authored by ennetws on 13 March 2015, 18:17:18 UTC, committed by ennetws on 13 March 2015, 18:17:18 UTC
Create README.md
1 parent c702819
  • Files
  • Changes
  • adfc2e5
  • /
  • DynamicVoxel
  • /
  • DynamicVoxel.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:39b13612ebd645a65eda854771b517371f2f858a
directory badge
swh:1:dir:edd3ff344c75f506a69780cf3c38ee37c8e7341f
content badge
swh:1:cnt:f84f92ee24937875594dacf315b78de4b447ea54

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
DynamicVoxel.h
#pragma once

#include "SurfaceMeshModel.h"

#include "Voxel.h"
#include "../CustomDrawObjects.h"

namespace DynamicVoxelLib{

class DynamicVoxel
{
public:
    DynamicVoxel(double voxelSize = 0.1);

    void draw();

    std::vector<Voxel> voxelSphere(double radius);
    std::vector<Voxel> voxelTorus(double pathRadius, double circleRadius);
    std::vector<Voxel> voxelLine(const Vector3d & p1, const Vector3d & p2, bool thick = false);
    std::vector<Voxel> voxelCircle(double radius);
    std::vector<Voxel> orientedVoxelCircle(double radius, const Vector3d &direction);

    void addLine(const Vector3d & p1, const Vector3d &p2);
    void addSphere(const Vector3d & center, double radius);
    void addHemiSphere(const Vector3d & center, double radius, const Vector3d &direction=Vector3d(0,0,1));
    void addCircle(const Vector3d & center, double radius, const Vector3d &direction=Vector3d(0,0,1));
    void addCylinder(const Vector3d & from, const Vector3d & to, double radius);
    void addCapsule(const Vector3d & from, const Vector3d & to, double radius);
    void addPolyLine(const QVector<Vector3d> &points, double radius);
    void addTorus(const Vector3d & center, double pathRadius, double circleRadius, const Vector3d &direction=Vector3d(0,0,1));
	void addBox(const Vector3d & minimum, const Vector3d & maximum);

    void begin();
    void setVoxel(int x, int y, int z);
    void end();

    std::vector<Voxel> voxels;

	double voxel_size;
    Voxel minVoxel, maxVoxel;

	struct QuadMesh{
        std::vector<SurfaceMesh::Vector3> points, debug;
		std::vector<QuadFace> faces;
		void clear() { points.clear(); faces.clear(); }
	};

	QuadMesh toQuadMesh();

    void buildMesh( SurfaceMesh::Model * mesh );
    void buildMesh( SurfaceMesh::Model * mesh, QuadMesh & m );

	// Mesh smoothing
    static void MeanCurvatureFlow( SurfaceMesh::Model *m, double dt = 0.5 );
    static void LaplacianSmoothing( SurfaceMesh::Model *m, bool protectBorders = false );

	// Basic hole filling
    static void FillHoles( SurfaceMesh::Model *m, double voxel_length );
    static bool hasHoles( SurfaceMesh::Model *m );
};

}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API