Skip to content

Instantly share code, notes, and snippets.

View jimfoltz's full-sized avatar

Jim Foltz jimfoltz

View GitHub Profile
@jimfoltz
jimfoltz / cannon.rb
Last active August 29, 2015 13:57
Projectile Motion Animation SketchUp
class Cannon
def initialize(bearing, elev, velocity)
@item = Sketchup.active_model.entities[0]
@t = 0
@v = velocity.to_f
@angle = elev.to_f
@bearing = bearing.to_f
@vy = @v * Math::cos(@angle.degrees)
@vz = @v * Math::sin(@angle.degrees)
# jf_attach_camera_to_sun.rb (C) jim.foltz@gmail.com
#
# Name: Sun Tool
#
module JF
module AttachCameraToSun
VERSION = '1.0.0'.freeze
require 'socket'
require 'nokogiri'
require 'nori'
require 'pp'
SETTINGS = "C:/ProgramData/SketchUp/RubyDebugger.settings"
def main
@parser = Nori.new
if not defined?(JF::ZoomCrosshairs)
UI.menu("Camera").add_item("Zoom Crosshairs") {
Sketchup.active_model.select_tool(JF::ZoomCrosshairs.new)
}
end
module JF
class ZoomCrosshairs
=begin
This is how you to delete a Layer prior to SketchUp 2015.
SketchUp >= 2015 has a Layer.delete method.
(c) TIG 2009
layer-delete.rb adds a new Method the Sketchup's Layer Class-
"layer.delete()" - it deletes that layer from the model and
entities that used it get the default layer instead...
@jimfoltz
jimfoltz / att_reporter.rb
Last active August 29, 2015 14:10
Overview Attching DC Attributes to Component in SketchUp
# http://sketchucation.com/forums/viewtopic.php?p=124392#p124392
#----------------------------------------------------------------------------#
## Copyright 2005-2008, Google, Inc.
# This software is provided as an example of using the Ruby interface
# to SketchUp.
# Permission to use, copy, modify, and distribute this software for
# any purpose and without fee is hereby granted, provided that the above
# http://stackoverflow.com/a/17982272/816093
module TransformationHelper
def flipped_x?
dot_x, dot_y, dot_z = axes_dot_products()
dot_x < 0 && flipped?(dot_x, dot_y, dot_z)
end
def flipped_y?
#get vertices
def start
#get vertices
verts=[] #initialize vertices array
trans_h=[] #initialize transformation array use to store hierarchy of transformations
verts=createVerticesArray(sel,trans_h,verts)
end
def createVerticesArray(sel,trans_h,verts)
sel.each{|ent|
class Node
attr_reader :ins, :name, :path
def initialize(ins, path, name)
@ins = ins
@path = path
@name = name
end
DROP TABLE "Patient Medication" IF EXISTS;
DROP TABLE "Medication" IF EXISTS;
DROP TABLE "Payment" IF EXISTS;
DROP TABLE "Schedule" IF EXISTS;
DROP TABLE "Assignment" IF EXISTS;
DROP TABLE "Therapists Number" IF EXISTS;
DROP TABLE "Phone Number" IF EXISTS;
DROP TABLE "Patient" IF EXISTS;
DROP TABLE "Psychiatrist" IF EXISTS;
DROP TABLE "Medical Doctor" IF EXISTS;