From patchwork Thu Sep 15 13:16:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul A. Patience" X-Patchwork-Id: 42638 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E52CE27BBEA; Thu, 15 Sep 2022 14:29:58 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6519027BBE9 for ; Thu, 15 Sep 2022 14:29:58 +0100 (BST) Received: from localhost ([::1]:43886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYowG-0006nl-G5 for patchwork@mira.cbaines.net; Thu, 15 Sep 2022 09:29:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYojm-0001WO-AJ for guix-patches@gnu.org; Thu, 15 Sep 2022 09:17:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYojm-0003L0-1n for guix-patches@gnu.org; Thu, 15 Sep 2022 09:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYojl-00079Y-Sk for guix-patches@gnu.org; Thu, 15 Sep 2022 09:17:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57828] [PATCH] gnu: Add discregrid. Resent-From: "Paul A. Patience" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Sep 2022 13:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57828 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57828@debbugs.gnu.org Cc: "Paul A. Patience" X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166324781627474 (code B ref -1); Thu, 15 Sep 2022 13:17:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Sep 2022 13:16:56 +0000 Received: from localhost ([127.0.0.1]:57482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYojg-000793-0N for submit@debbugs.gnu.org; Thu, 15 Sep 2022 09:16:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:56478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYojd-00078v-Mz for submit@debbugs.gnu.org; Thu, 15 Sep 2022 09:16:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYojd-0001Gi-Fd for guix-patches@gnu.org; Thu, 15 Sep 2022 09:16:53 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:47071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYojZ-0003Hn-MW for guix-patches@gnu.org; Thu, 15 Sep 2022 09:16:53 -0400 Date: Thu, 15 Sep 2022 13:16:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apatience.com; s=protonmail3; t=1663247797; x=1663506997; bh=9q80soE4KrL4VTWxo0sWpvoU48xW6HJ6I0WvZw35ws8=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=QlpAIlrCFy/0UIRtsVp0RftA8NikHqWiyShECMyDdIF9B1EutHhQNPq3g9mSxMJBn Snj9Om38gGIYNANYkAOP5nlTAZiGFfhJ4uUBl4cbZDfWMgWq6oEhvqiCLHgnBHORSH m6VzLfAEKaEt2l7JZASDaZAasPXGOUr9OeZbayYKq9UGxpRvW313FKUQgekofTm/1d iXyeG3UW8+ft5MSK/uyjqWt+7VJo/CQEbVq9yjACcFKEcbOkLYspTVQKs4t3lTwhBy J9Watmz6fNKM/D9PjNx5E+Xdy1YsGx9zxW2+AhDppdmvu08jw9I2PBrgh5bWO1fZxE GFIyWSEBIybbg== From: "Paul A. Patience" Message-ID: <20220915131616.1130446-1-paul@apatience.com> Feedback-ID: 19227857:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.23; envelope-from=paul@apatience.com; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/graphics.scm (discregrid): New variable. --- gnu/packages/graphics.scm | 69 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) -- 2.37.3 diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index ef17f059e6..cb03cc36e5 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -2202,6 +2202,75 @@ (define-public azpainter ") (license license:gpl3+))) +(define-public discregrid + (let ((commit "4c27e1cc88be828c6ac5b8a05759ac7e01cf79e9") + (revision "0")) + (package + (name "discregrid") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/InteractiveComputerGraphics/Discregrid") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "01cwfpw19rc9k5glx9dhnqpihd0is28a9b53qvzp5kgjmdq2v1p0")) + (modules '((guix build utils))) + (snippet + #~(begin + (delete-file-recursively "extern/cxxopts") + (substitute* '("cmd/discrete_field_to_bitmap/main.cpp" + "cmd/generate_density_map/main.cpp" + "cmd/generate_sdf/main.cpp") + (("^#include ") + "#include ")))))) + (build-system cmake-build-system) + (outputs '("out" "bin")) + (arguments + (list #:tests? #f ; No tests + #:configure-flags + #~(list (string-append "-DCMAKE_INSTALL_BINDIR=" + #$output:bin "/bin") + ;; Bespoke version of BUILD_SHARED_LIBS. + "-DBUILD_AS_SHARED_LIBS=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-cmake + (lambda _ + (let ((port (open-file "cmd/CMakeLists.txt" "a"))) + (display "install(TARGETS + DiscreteFieldToBitmap + GenerateDensityMap + GenerateSDF) +" + port) + (close-port port))))))) + (inputs + (list cxxopts eigen)) + (home-page "https://github.com/InteractiveComputerGraphics/Discregrid") + (synopsis "Discretize functions on regular grids") + (description "Discregrid is a C++ library for the parallel discretization +of (preferably smooth) functions on regular grids. It generates a (cubic) +polynomial discretization given a box-shaped domain, a grid resolution, and a +3D scalar field. The library can also serialize and deserialize the generated +discrete grid, and compute and discretize the signed distance field +corresponding to a triangle mesh. The following programs are included with +Discregrid: + +@itemize +@item @code{GenerateSDF}: Computes a discrete (cubic) signed distance field +from a triangle mesh in OBJ format. + +@item @code{DiscreteFieldToBitmap}: Generates an image in bitmap format of a +two-dimensional slice of a previously computed discretization. + +@item @code{GenerateDensityMap}: Generates a density map from a previously +generated discrete signed distance field using the cubic spline kernel. +@end itemize") + (license license:expat)))) + (define-public mmg (package (name "mmg")