Skip to content

Instantly share code, notes, and snippets.

View dov's full-sized avatar

Dov Grobgeld dov

  • Rehovot, Israel
View GitHub Profile
@dov
dov / vsg-select-rectangle.cpp
Created October 12, 2024 19:02
VulkanSceneGraph rectangular selection input
//======================================================================
// select-rectangle.cpp
//
// This program should demonstrate how to select multiple objects
// by drawing a rectangle with the mouse.
//
// This snippet is licensed under the MIT license.
//
// Dov Grobgeld <[email protected]>
// 2024-10-11 Fri
//======================================================================
// select-rectangle.cpp
//
// This program should demonstrate how to select multiple objects
// by drawing a rectangle with the mouse.
//
// This snippet is licensed under the MIT license.
//
// Dov Grobgeld <[email protected]>
// 2024-10-11 Fri
@dov
dov / hello-shader.cpp
Created July 20, 2024 20:53
Testing using a custom uniform in a shader in VSG
//======================================================================
// This is an example of using a custom uniform in a shader.
//
// 2024-07-20 Sat
// Dov Grobgeld <[email protected]>
//----------------------------------------------------------------------
#include <vsgXchange/all.h>
#include <iostream>
@dov
dov / hello-picking.cpp
Created July 3, 2024 17:35
Example of how to highlight object picking in Vulkan Scene Graph
//======================================================================
// hello-picking.cpp - An example of how to select and change the
// color of objects created with the builder in Vulkan Scene Graph.
//
// This file is licensed under the MIT license.
//
// Dov Grobgeld <[email protected]>
// Tue Jul 2 21:59:01 2024
//----------------------------------------------------------------------
@dov
dov / hello-gizmo.cpp
Created June 14, 2024 15:58
First effort of a orienter gizmo for Vulkan Scene Graph
//======================================================================
// hello-box.cpp - Show a box with vsg viewer
//
// Extended to add keyboard interaction
//
// Dov Grobgeld <[email protected]>
// Sat Mar 16 23:25:06 2024
//----------------------------------------------------------------------
#include <vsg/all.h>
@dov
dov / ocp-fillet-corner.py
Created March 14, 2024 07:56
Creating fillets with OCP
#!/usr/bin/python
######################################################################
# Example of how to use ChFi2d_FilletAPI to create fillets.
#
# 2024-03-14 Thu
# Dov Grobgeld <[email protected]>
#
# This file is in the public domain
######################################################################
@dov
dov / fish-to-cq.py
Last active April 22, 2024 17:47
Proof of concept importing svg into CadQuery
#!/usr/bin/python
######################################################################
# A proof of concept adding a svg path into a cadQuery Workspace
# object.
#
# This file is in the public domain.
#
# Dov Grobgeld <[email protected]>
# 2024-03-10 Sun
@dov
dov / shampoo-holder.py
Created February 10, 2024 22:01
A shampoo holder created with CadQuery
#!/usr/bin/env python
######################################################################
# A cup holder
# 2024-02-10 Sat
# Dov Grobgeld <[email protected]>
#
# This code is in the public domain.
#
# The shower pole shampoo holder is built as follows
@dov
dov / toggle-backslash.el
Created October 25, 2023 13:08
Toggle between backslashes and forward slashes
(defun toggle-backslash-line ()
"Toggle all forward slashes to backslashes for the current line."
(interactive)
(save-excursion
(if (use-region-p)
(setq myBoundaries (cons (region-beginning) (region-end)))
(setq myBoundaries (bounds-of-thing-at-point 'line)))
(save-restriction
(goto-char (car myBoundaries))
@dov
dov / shell-command-on-buffer.el
Created October 25, 2023 07:39
Evaluate the current file in local or remote shell
(if (string-match "x86_64-w64-mingw32" system-configuration)
(setq temp-dir "C:/Temp")
(setq temp-dir "/tmp"))
(defun shell-command-on-buffer (command extension)
"Send the current buffer to a shell command"
(interactive)
(let* ((remote-maybe (file-remote-p default-directory))
(tramp-prefix (if remote-maybe remote-maybe ""))
(cmd-buffer-name (concat "*" (capitalize command) " Output*"))