Skip to content

Instantly share code, notes, and snippets.

@DanRathbun
DanRathbun / copy_face_materials_2021.1.rb
Created October 29, 2021 19:07
Projected Textures: An example using the new SketchUp v2021.1 functionality
# Copy face materials (front and back) from a source face to a target face.
# For v2021.1 and higher, any texture positioning and projection is copied.
# @param face1 [Sketchup::Face] the source face.
# @param face2 [Sketchup::Face] the target face.
# @return [Boolean] whether texture positioning was enabled during copy.
def copy_face_materials(face1, face2)
# Test if the API is at or higher than 2021.1:
positioning_enabled = face1.respond_to?(:texture_projected?)
#
frontside = true
@DanRathbun
DanRathbun / SketchUp_Ruby_System.rb
Created January 13, 2020 18:43
SketchUp Embedded Ruby System module
# encoding: UTF-8
#
# Boilerplate Ideas for SketchUp Embedded Ruby System module.
if (Sketchup.platform == :platform_win rescue RUBY_PLATFORM !~ /darwin/)
module System # for MS Windows
require 'win32ole'
@DanRathbun
DanRathbun / SketchUp_Ruby_System_Paths.rb
Last active January 13, 2020 18:35
SketchUp Embedded Ruby System::Paths module
# encoding: UTF-8
#
# Boilerplate Ideas for SketchUp Embedded Ruby System::Paths module.
require 'SketchUp_Ruby_System'
module System
if (Sketchup.platform == :platform_win rescue RUBY_PLATFORM !~ /darwin/)
@DanRathbun
DanRathbun / plytkowanie.rb
Created March 4, 2012 05:43 — forked from Tener/plytkowanie.rb
Plugin for sketch up - fixed up somewhat by Dan Rathbun
###
###
##### SAVE IN FORMAT: "UTF-8 WITHOUT BOM" OR "ANSI AS UTF-8"
###
###
# Wtyczka: "P-ytkuj"
# Autor: Krzysztof Skrzrtnicki
# Licencja: GPLv3
# Wersja: 2.0