Bug 50998 - add "coil" to draw basic shape menu
Summary: add "coil" to draw basic shape menu
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords: difficultyInteresting, easyHack, skillDesign, topicUI
Depends on:
Blocks: Gallery Shapes-Custom
  Show dependency treegraph
 
Reported: 2012-06-12 02:30 UTC by cousteau
Modified: 2019-02-23 03:40 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cousteau 2012-06-12 02:30:23 UTC
There's no easy way to draw springs, coils, sinusoids, etc.  The only way to do this is with a bézier curve (too much precision required), hand-drawn (even more), or with ellipse arcs (and everyone knows how ugly a "sinusoid" drawn with half ellipses is).

It might be a good idea to include a line shape that allowed to draw
* a sinusoid
* a "coil" or "spring"
* a cycloid or trochoid (I doubt anyone actually wants to draw this, but it would be a particular case of "coil")

The parametric formula (for a horizontal coil) is

  { x = t * L/2pi + e*H/2 * cos(t+t0)
  { y = H/2 * sin(t+t0)
  { for t = 0 ... W / (L/2pi)

where H is the height (amplitude), W the width (length), L the distance between loops (wavelength), e the eccentricity (e=0: sinusoid; e=1: trocoid; 0<e<1: another coil-shaped line), and t0 the initial phase.
Comment 1 tommy27 2014-12-13 10:11:49 UTC
enhancement request. inherited from OOo
Comment 2 Heiko Tietze 2016-05-04 12:17:41 UTC
While having a function plotter in Draw sounds interesting, I'd say this is out of scope. As a workaround (it's rather the intended interaction in an office suite) you could enter the function in Calc, plot the data and copy/paste the result to Draw.
Comment 3 cousteau 2016-05-11 07:56:16 UTC
I want to clarify that the main point of this report was not plotting arbitrary functions nor rigorously accurate shapes, but rather to provide a shape that *resembles* a "wave" or a "spring".  This would be useful in the same way that it's useful to have curved arrows, clouds, or smileys; i.e. to decorate drawings and presentations.
The mathematical functions I wrote were just one way to generate them, although I guess that approximating it with Bézier curves would be easier to implement (it does not need to be an exact shape; just something that "looks like a coil").

(I mentioned the cycloid and trochoid just because they were just particular cases of "a coil in perspective", not because I thought those mathematical shapes were necessary.  Maybe it was a mistake to mention them since they're out of the point of this report.)
Comment 4 Heiko Tietze 2016-06-01 07:44:35 UTC
(In reply to cousteau from comment #3)
> I want to clarify that the main point of this report was not plotting
> arbitrary functions nor rigorously accurate shapes, but rather to provide a
> shape that *resembles* a "wave" or a "spring". 

Sorry, misunderstood this. Wouldn't this shape have an odd size limitation? And what category do you suggest for this type of shape? I mean, currently we have way too many categories and objects in the gallery. That might be convenient for users who know what they are looking for but browsing through the gallery is a pain.
Comment 5 cousteau 2016-07-07 23:41:34 UTC
Probably the Symbols category would be the best suited.

What do you mean with size limitation?
Comment 6 Heiko Tietze 2016-07-08 08:47:48 UTC
(In reply to cousteau from comment #5)
> What do you mean with size limitation?

Gallery objects have a fix size, and when you need a coil with 200px you have to scale up the predfined 100px object (for example) to double its original size.

(In reply to Heiko Tietze from comment #2)
> While having a function plotter in Draw sounds interesting, I'd say this is
> out of scope. 

Not so sure anymore, and perhaps it can be done easily. Such a special curve could start as a simple sinusoid and offer special options. Could be an outstanding feature.
Comment 7 Heiko Tietze 2019-02-22 11:03:11 UTC
The coil could be an interesting object for custom shapes, if possible.