Sha256: 17a31d749c12a4bf7c38d03f7fc8ab28e68b10b7d139ba57b90c0cbf2b66ca06

Contents?: true

Size: 728 Bytes

Versions: 7

Compression:

Stored size: 728 Bytes

Contents

require 'mittsu/core'
require 'mittsu/math'
require 'mittsu/extras/geometries/torus_knot_buffer_geometry'

module Mittsu
  class TorusKnotGeometry < Geometry
    def initialize(radius = 100.0, tube = 40.0, radial_segments = 64, tubular_segments = 8, p_val = 2, q_val = 3)
      super()

      @type = 'TorusKnotGeometry'

      @parameters = {
        radius:           radius,
        tube:             tube,
        radial_segments:  radial_segments,
        tubular_segments: tubular_segments,
        p_val:            p_val,
        q_val:            q_val
      }

      from_buffer_geometry(TorusKnotBufferGeometry.new(radius, tube, tubular_segments, radial_segments, p_val, q_val))
      merge_vertices
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mittsu-0.5.0 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.4.1 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.4.0 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.3.3 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.3.2 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.3.1 lib/mittsu/extras/geometries/torus_knot_geometry.rb
mittsu-0.3.0 lib/mittsu/extras/geometries/torus_knot_geometry.rb