Drawing Sine Curve?


#1

Hello.
I am looking how to draw a surface defined by a function.

The closest I have managed are multiple “steps”, each step being defined by (i.e.) Z=sin(X).
Ideally I would like a scalable group, that could then return key values.

Is this possible with DC, or solely the realm of Ruby?

Thanks in advance.


#2

Try a plugin to get the graph (which then can be scaled).
example:http: www.smustard.com/script/GraphIt

I was thinking of another one but haven’t found it yet.

p.s. the created graph represents the graph in segmented form in SketchUp and is plain geometry, edges forming a segmented curve. So be careful with a scaled version as to what math equation that will represent! Or just input a second math equation in the plugin.


#3

There have been similar requests before. Search the forum for ‘sine curve’ and you will find four other posts on this or a related subject. They may be helpful.


#4

PolyGen?


#5

Thanks - I did search beforehand.
It seems that all the solutions have been ruby based - nothing DC.


#6

the copy in the copies function works for maths formula and graphs

sine wave.skp (164.3 KB)


#7

Thank you


#8

Interesting. Is it supposed to look like this?


#9

it is just an example on how to use copy as a variable to form a shape or a set of points, y=sin(copy) is like y=sin(x), its a starting point where further development like rotating and sizing the copy length can join the “dots”, like the arc tool the number of segments will get closer to the perfect, So with the sample, the range, pitch, frequency are things one can explore in ones development of the function.


#10

Thanks pcmoor, that is very interesting. That is along the lines of what I am trying to do.
I’ll play around with this.

Is there any way to join the segments to make a surface (segment starts at x=n, ends at x=n+1)?

Thanks again.


#11

Try the Draw Metal LLC Taper maker, Curve maker and Stock maker plugins for Sketchup. Be aware the length of a sine curve cannot calculated by use of your equation. For that you will have to use a ellipitic integeral since there is no closed form solution for that if you want accurate number.


#12

one could produce the segmented path along the sine curve, then attach a DC form for the follow me tool. I created a ligature based on this concept

http://sketchucation.com/forums/viewtopic.php?f=289&t=63649

in forming the path, as per a previous post…

then you add sides and base to form a surface then extrude that


#13

Not sure if this is the same .rb as posted above.
It was created via a request I made in SketchUcation years ago.
I used it to create the path of a huge floating sewer line. Worked great.

Sine_wave.rb:

require “sketchup”

module JF
def self.draw_sine_wave
pr = %w( Length Amplitude Segments )
de = [10, 5, 24]

    ret = UI.inputbox(pr, de)
    return unless ret
    #a = 10.0.feet
    #b = 250.0.feet
    b, a, s = ret.map{|e| e.to_l}
    pts = []
    0.step(b, b/s) do |x|
        y = a * Math::sin( (x / b) * 2 * Math::PI)
        pts << [x, y]
    end
    Sketchup.active_model.start_operation("Sine Wave")
    grp = Sketchup.active_model.active_entities.add_group
    entities = grp.entities
    entities.add_edges pts
    Sketchup.active_model.commit_operation

end

end
unless file_loaded? "sine_wave.rb"
UI.menu(“Draw”).add_item(“Sine Wave”) { JF.draw_sine_wave }
file_loaded "sine_wave.rb"
end

New photo by John Clements
|
New photo by John Clements


#14

Thank you all for your suggestions - Here is the component that I used - It works with sine, but can be tweaked to work with other functions.

sine wave.skp (248.2 KB)


#16

This topic was automatically closed after 91 days. New replies are no longer allowed.