* [bug#57828] [PATCH] gnu: Add discregrid.
@ 2022-09-15 13:16 Paul A. Patience
2022-10-06 14:18 ` bug#57828: " Christopher Baines
0 siblings, 1 reply; 2+ messages in thread
From: Paul A. Patience @ 2022-09-15 13:16 UTC (permalink / raw)
To: 57828; +Cc: Paul A. Patience
* gnu/packages/graphics.scm (discregrid): New variable.
---
gnu/packages/graphics.scm | 69 +++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
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 <cxxopts/cxxopts\\.hpp>")
+ "#include <cxxopts.hpp>"))))))
+ (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")
--
2.37.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#57828: [PATCH] gnu: Add discregrid.
2022-09-15 13:16 [bug#57828] [PATCH] gnu: Add discregrid Paul A. Patience
@ 2022-10-06 14:18 ` Christopher Baines
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Baines @ 2022-10-06 14:18 UTC (permalink / raw)
To: Paul A. Patience; +Cc: 57828-done
[-- Attachment #1: Type: text/plain, Size: 373 bytes --]
"Paul A. Patience" <paul@apatience.com> writes:
> * gnu/packages/graphics.scm (discregrid): New variable.
> ---
> gnu/packages/graphics.scm | 69 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 69 insertions(+)
Thanks Paul, good job especially with replacing the bundled
cxxopts. I've pushed this to master as
5b42b64ea89564c58325d16d3d0f4a0a03ebae0f.
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-06 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 13:16 [bug#57828] [PATCH] gnu: Add discregrid Paul A. Patience
2022-10-06 14:18 ` bug#57828: " Christopher Baines
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).