Fluid freehand

Fluid freehand

Postby Box » Wed Apr 26, 2017 5:04 pm

I'm not really sure if this is a feature request or a plugin.
With the increase in touch screen interface and stylus input I'm wondering if the freehand tool can be made better.
With a mouse it has always been a fairly jagged tool but with a stylus it would be nice to be able to produce a fluid line.
There seems to be a correlation between the speed of the stroke and the number of segments which is sort of counter intuitive. If you do a fast smooth arc it will give it four segments, but the same arc done slowly will be 37 segments, but they won't be smooth. They can be smoothed with fredo's curvizard but I'd rather a freehand tool that will follow your stylus smoothly. Or one that I can tell it how many segments per mm.
Any ideas? or examples needed?
3
User avatar
Box 
 

Re: Fluid freehand

Postby Rich O Brien » Wed Apr 26, 2017 9:25 pm

Thomthom made a Stylus tool a few years ago. Never released it though but maybe PM him.
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: Fluid freehand

Postby thomthom » Mon May 15, 2017 9:59 am

The stylus tool I'd been tinkering with was a means to quickly generate meshes - mainly focused on quads. The idea was that you'd trace an image and build your quads from that. (Or create new topology on top of existing geometry.)

Stylus.gif


I'm not sure how easy Box' request would be. At least with what control you have from the SU API. Because the smoothness of the points depend on how quickly you can receive the input. In my stylus I collect points as fast as I receive callbacks. And as you can see it's still somewhat jagged:

StylusDraw.gif


Granted, it'll be more jagged the more I do during mouse movement and drawing to the viewport. Maybe it could be improved. But I think that in general, with user input like this you need to interpolate in order to get smooth result.

I actually had a similar conversation a couple of weeks ago, while talking to some VR developers in a co-working space nearby. They were playing around with VR presentation tool in Unity and had added a tool to do drawing in the VR world. But also there you had the problem of jittery input

Same thing, if you move fast you got fewer more jagged points, if you move slow you get more points (not necessarily smoother, as your hand create jitters) It all boils down to how quickly you are able to sample input.
1
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: Fluid freehand

Postby Box » Mon May 15, 2017 12:17 pm

Hmm yep, I see the issues involved.
What about if the freehand line could somehow be converted into one of fredos beziers.
ie: draw a line as fast or slow as you like but when you stop it makes a smooth curve based on a certain number of control points? more points in the slow section and less in the fast section. or a predetermined number spread over the length of the curve, but smooth.
1
User avatar
Box 
 

Re: Fluid freehand

Postby JQL » Mon May 15, 2017 1:33 pm

That would be cool and the bezier aproach would be nice to have.

I also love the idea of the quad stylus. It looks like some retopology tool I've seen in some software I don't remember anymore. Tracing an image with that and having a quadmesh created seems very useful but I can think of a lot of useful scenarios...

Maybe one day my architecture will have some motive to get out of the boxed state it's in...
0
User avatar
JQL 
Premium Member
Premium Member
 

Re: Fluid freehand

Postby Rich O Brien » Mon May 15, 2017 2:15 pm

@box

What about Fredo's Smooth Contour in Curvizard?
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: Fluid freehand

Postby Box » Mon May 15, 2017 2:23 pm

Yeah Rich I mentioned that in my original post, it works, but I'm trying to get it built in rather than a workaround.
0
User avatar
Box 
 

Re: Fluid freehand

Postby Box » Mon May 15, 2017 2:59 pm

And I agree with you JQL.

I can see this sort of touch interface being quite important pretty soon.
People already avoid mouse and keyboard if they can.
A well structured Stylus tool would will be invaluable in the near future, in my humble opinion.
1
User avatar
Box 
 

Re: Fluid freehand

Postby pbacot » Mon May 15, 2017 4:04 pm

Seems to me this might be effective if you could draw on a surface. So you establish a base framework by drawing on a sphere, plane or other shape to define how your grid begins.
1
MacOSX (El Capitan) ShetchUp Pro v16 Layout Twilight Pro v2 M2 Kerkythea PowerCADD
User avatar
pbacot 
Top SketchUcator
 

Re: Fluid freehand

Postby Box » Mon May 15, 2017 4:11 pm

pbacot wrote:Seems to me this might be effective if you could draw on a surface. So you establish a base framework by drawing on a sphere, plane or other shape to define how your grid begins.

Sounds goood, come on Thomas, SUbD is fantastic, this could be brilliant.
1
User avatar
Box 
 

Re: Fluid freehand

Postby thomthom » Mon May 15, 2017 4:20 pm

Box wrote:Hmm yep, I see the issues involved.
What about if the freehand line could somehow be converted into one of fredos beziers.
ie: draw a line as fast or slow as you like but when you stop it makes a smooth curve based on a certain number of control points? more points in the slow section and less in the fast section. or a predetermined number spread over the length of the curve, but smooth.

Yup, that should work. Though there is many ways to convert to a curve. I suspect in most cases you want a smooth curve that is as close as possible to the original.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: Fluid freehand

Postby Box » Mon May 15, 2017 4:24 pm

thomthom wrote:I suspect in most cases you want a smooth curve that is as close as possible to the original.


That would be very nice.


Feel free to bombard me with test .rb's
0
User avatar
Box 
 

Re: Fluid freehand

Postby JQL » Mon May 15, 2017 4:46 pm

thomthom wrote:Yup, that should work. Though there is many ways to convert to a curve. I suspect in most cases you want a smooth curve that is as close as possible to the original.


Do we really need a curve? I'd love it to be grouped and SUbDeable instead of a curve.

A curve in sketchup is very hard to manipulate, however, if you'd find some way to subdivide edges as you do with faces in SUbD...

We would be talking big game here! We could go inside the group and simply edit a vertex and the curve would change!

After all if you can subdivide faces... it should be way easier with edges and people that follow SUbD logic would easilly adapt to SUbE logic
0
User avatar
JQL 
Premium Member
Premium Member
 

Re: Fluid freehand

Postby Pixero » Tue May 16, 2017 12:28 pm

@thomthom
Is there any way of getting hold of your stylus script?
Would love to try it.
0
User avatar
Pixero 
Premium Member
Premium Member
 

Re: Fluid freehand

Postby driven » Tue May 16, 2017 4:22 pm

the way it works in Preview.app would be good...

in_preview.gif


john
1
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: mingteck and 4 guests

Visit our sponsors: