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

https://github.com/GTMeijer/Prickliness
10 August 2026, 22:39:23 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • 7d1d9c1c9d76fee0d09beff2396006f8754e8613
    No releases to show
  • c360f8c
  • /
  • prickliness.h
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:19d2b0bf99a3c0d7fab6b060795fba37e87f1a69
origin badgedirectory badge
swh:1:dir:c360f8c5b838bfe88910d26aad151dee69f69364
origin badgerevision badge
swh:1:rev:7d1d9c1c9d76fee0d09beff2396006f8754e8613
origin badgesnapshot badge
swh:1:snp:f98118b47019c7c99d3f8ca36e76fdf56e9f5b39

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.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 7d1d9c1c9d76fee0d09beff2396006f8754e8613 authored by Gert Meijer on 06 May 2021, 03:23:18 UTC
Base code files push
Tip revision: 7d1d9c1
prickliness.h
#pragma once

namespace Prickliness
{
    //2D arrangements
    struct PerpPlaneIndices
    {
        bool operator==(const PerpPlaneIndices& rhs) const
        {
            return (vertexIndex == rhs.vertexIndex && planeIndex == rhs.planeIndex);
        }

        int vertexIndex = -1;
        int planeIndex = -1;
    };

    //Struct wrapping the localMaximaCount per face so we can instantiate it with -1
    struct FaceCounter
    {
        int localMaximaCount = -1;
    };

    typedef CGAL::Arr_linear_traits_2<Kernel> Arr_traits_2;
    //typedef CGAL::Arr_segment_traits_2<Kernel> Arr_segment_traits_2;
    //Use the consolidated curve data traits to add a data field to the lines, if they overlap these traits will automatically append them in a list
    //This is used to keep track of the accompanying perp plane and terrain vertex
    typedef CGAL::Arr_consolidated_curve_data_traits_2<Arr_traits_2, PerpPlaneIndices> Arr_segment_data_traits_2;
    //Construct a DCEL that adds auxiliary data to every face (local maxima count)
    typedef CGAL::Arr_face_extended_dcel<Arr_segment_data_traits_2, FaceCounter> DCEL;
    typedef CGAL::Arrangement_2<Arr_segment_data_traits_2, DCEL> Arrangement_2;

    typedef Arr_segment_data_traits_2::X_monotone_curve_2 Arr_X_monotone_curve_2;
    typedef Arr_segment_data_traits_2::Line_2 Arr_data_line_2;
    typedef Arr_segment_data_traits_2::Curve_2 Arr_data_curve_2;
    typedef Arrangement_2::Face_handle DCELFaceHandle;

    class PricklinessArrangement
    {
    public:

        PricklinessArrangement(const Delaunay& DT);

        void Draw();
        void WriteToIpe(const std::filesystem::path& filePath, bool centerOnOrigin);

        int prickliness = 0;
        Vector_3 pricklyDirection;

        void WriteToFile(const std::filesystem::path& filePath) const;
        void ReadFromFile(const std::filesystem::path& filePath) const;

    private:

        //Get a vector to a point inside a convex DCEL plane
        Vector_3 GetVectorInPlane(const Arrangement_2::Face_const_handle face) const;

        bool IsBoundaryVert(const Delaunay& DT, Delaunay::Face_circulator adjacentFaces) const;

        Arrangement_2 resultArrangement;

        struct PricklyColor
        {
            double r;
            double g;
            double b;
        };

        PricklyColor GetColorForPercentage(double percent) const;
    };
}

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