maintain stroke while stretching shape, after effects - expression

I am trying to stretch and expand this shape without changing the stroke weight but nothing seems to be working. I am working with stroke and using expression to keep the stroke proportionate but so far nothing works.
this is what my screen looks like right now
the expression being used: value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001;
this is currently what happened when i tried to stretch/expand it

place the shape in a separate group with no fill or stroke. and place the stroke under the group outside. use group transform instead of transforming the layer itself. In other words - transform shapes BEFORE they get any stroke.

Related

ChartJS - x axis labels orientation

Is it possible to change x-axis label orientation like marked area on the screenshot? I was trying rotate labels with afterCalculateTickRotation but they weren't flipped. Mirror option doesn't work also.
Example code
I managed to do what you are asking for but it's not beautiful because chart.js lacks support to do it properly. So I solved it with some hard coded padding.
https://codesandbox.io/s/vue-template-4ygr1
It's the minRotation and maxRotation you should work with. The labels anchoring point should shift when the rotation goes below zero but they don't. Instead they rotate into the chart but this can be avoided with padding.
A side effect of the padding is that the legend placement broke so i put it in the top instead.
Another unwanted behavior is that the text is aligned to the right. There is an open issue about that: https://github.com/chartjs/Chart.js/issues/4193

texture not applied properly with Three.js

I work with Forge Autodesk, and I want to apply a texture to some rectangle object. In fact I just needed some plan, but I was given a rectangle. So I want to apply my image on the main face of the rectangle.
const mytex = THREE.ImageUtils.loadTexture(mytexture)
// Repeat image through object
mytex.wrapS = THREE.RepeatWrapping //ClampToEdgeWrapping //MirroredRepeatWrapping //RepeatWrapping
mytex.wrapT = THREE.RepeatWrapping //ClampToEdgeWrapping //MirroredRepeatWrapping //RepeatWrapping
mytex.mapping = THREE.UVMapping
mytex.repeat.set (0.05, 0.05)
console.log("applied texture")
But I get this problem : a part of my image appears on the right upper side (upper and right corners are cut, so not on the rectangle), but the left and bottom sides are stretched across the rest of the rectangle face.
I would like to adapt my image so that its dimension fit the rectangle's dimensions, and not just repeat it.
I read this and this. I think my code is correctly written, but I may be missing a parameter or set the wrong one... The 2 images I am testing are 676x676 and 1024x484 pixels. I cannot access the rectangle dimensions from my function (I don't think so).
I tried to just repeat the image too but it does not work either...
Any idea ?

Need line drawing algorithm for simulating natural pencil

I'm writing a drawing program that uses a pressure sensitive table for input. I'd like to be able to simulate the soft pencil effect that many other art programs have (such as Paint Tool SAI, Art Rage). Technique I'm using at the moment is functional, but is missing the cleanness I see in more professional programs.
My algorithm at the moment works like this:
Create a bitmap representing the head of the brush. This is just a transparent bitmap with a black circle drawn on it. The circle has an inner radius that is solid black and an outer radius. The blackness linearly fades from opaque to transparent as you move from the inner to the outer radius.
Capture input events from my tablet. Each point contains an (x, y) coordinate as well as a pressure value
For every point after the first one, draw a line from the previous point to the current one. This is done by drawing (daubing) the brush bitmap several times between the two points. The step size between each daub is chosen so there is an overlap between subsequent daubs.
This works reasonably well, but the result is a line that is somewhat blobby and jagged.
One thing I need to do is somehow smooth out the input points so that the stroke as a whole is smooth.
The other thing I need to do is figure out how to 'drag' the brush head along this path to make the stroke. If the spacing is too far apart, the stroke looks like a line of circles. If too close together, the stroke builds up on itself and becomes very dark. (I tried to fix this by attenuating the brush by the spacing. This does make things more consistent, but stops the stroke from being fully opaque).
Anyhow, I'd expect that there's a lot of research already done on this, if only I knew where to look. Please let me know if there are any better pencil drawing algorithms out there.
Instead of drawing the new circle over what has already been drawn, using the standard blending functions (so that regions of overlap get a higher opacity), you need to keep the maximum opacity so far.
Only after you have built up the complete stroke (as on a white sheet), you can blend it to the existing line art.
The picture illustrates the difference between blending and keeping the maximum opacity.

3Ds Max CAT animation

In character animation toolkit: I've created an animation in the absolute layer. How can I set rotation keyframes for the whole character?
Example: In my abs layer, I have created a dancing animation. Apart from this, I would like my character to be rotating around its own axis too. However when I select the whole character and try to rotate it, limbs don't rotate around character's axis, but rather around their own axes.
In CATMotion layer, it could be done by choosing a path node, but how can I achieve the same effect in the abs animation layer?
The tool I was looking for is called a transform gizmo

How to get consistent gradient fill in GDI+ when using a rotated LinearGradientBrush?

I'm using GDI+ in my application, and I need to use a rotated LinearGradientBrush to paint several rects in the exact same way. However, although I'm calling the same code to fill each rect, the results aren't what I expect. Here's the code to create the gradient fill, where rcDraw is the rect containing the area to paint for each rect. These coordinates are in the parent window's coordinates, so they are not identical for the 2 rects.
g_hbrLinear = new LinearGradientBrush( Rect( 0, rcDraw.top, 0, rcDraw.bottom - rcDraw.top ),
clrStart, clrEnd, (REAL) 80, FALSE );
What I see on screen looks like this (http://www.nnanime.com/bugs/LinGradBrush-rotate10.png). You can see that it's as if the fill from the first rect continues into the second one. What I really want is to have the 2 rects look identical. I think I can do that if I paint each rect separately using its own client coordinates, but for the purposes of my app, I need to use the parent window's coordinates.
I guess what I'm asking is, how does GDI+ calculate the "origin" of a fill? Is it always based on 0,0 in the coordinate system you use? Is there a way to shift it? I tried TranslateTransform, but it doesn't seem to shift the fill in a way that I find predictable or understandable.
The rect passed to the linear gradient brush determines the where the left and right colors will sit, and the gradient will be painted within this rectangle.
So, I think you need to create a brush for each rectangle you are painting, where the rectangle you are painting is also passed to the constructor for the linear gradient brush.
My experience with the "transform" of linear gradient brushes matches yours; I haven't been able to understand what it's supposed to do.
You can think of a brush in GDI+ as a function mapping world co-ordinates to a color. What the brush looks like at a given point does not change based on the shape being filled.
It does change with the transform of the Graphics object you're drawing on. So, if you don't want to change the brush, you could temporarily change the transform of the Graphics object so that the rectangle you're drawing has a specific, known size and position in world coordinates. The BeginContainer and EndContainer methods should make this easy.
(There is also the RenderingOrigin property but it only affects hatch brushes, which oddly are unaffected by world transforms.)

Resources