(Autocad) How to draw this line (pic included) - autocad

How do you draw this kind of line that ends with fully filled 2 black circles ?

Related

Three JS - 3D animation along path

I need to create an animation using Threejs, where 24 objects (a 100px,50px,10px box) follow a path, moving and stoping intermitently every 200px smoothly, it means acceleration by 100px, deceleration on the next 100px and stop by "n" secconds.
This path must be formed by two semi circles connectes by lines, e.g. two semi circles with 400px diameter, connected by two lines of 1800px (like the letter "O").
Any idea about how to create that?
Thank you

How to fill different color for each section on a square which is divided by a single line?

I'm a newbie for Adobe XD and I was trying to fill different color for each section on a square, where square is divided by a single line. When I'm trying to fill it, it's automatically fills all over the square.
Please use a gradient for multi-color in a box.
See the below pic
You need a gradient that starts with a red color for example, then at the middle position add another red color. Next to it a blue and at the end the blue color again.
To translate this to positions that would be:
red at 0%
red at 50%
blue at 50%
blue at 100%
This will create a gradient with 2 colors, but instead of gradually fading from one to another, you have a harsh jump at the 50% position from red to blue.

How to trim text in Win2D using geometry

I know Win2D allows you to draw text within a specific rectangle and you can set it so that text not within that rectangle is clipped so that it isn't drawn.
I was wondering if it would be possible to do this with not just a rectangle but any Geometry (which may include curved lines)
What I get with rectangular clipping:
What I want (clipping by the white rounded rectangle with the curved bottom):
One of the CreateLayer overloads will probably do what you want:
http://microsoft.github.io/Win2D/html/Overload_Microsoft_Graphics_Canvas_CanvasDrawingSession_CreateLayer.htm

Drawing varying line widths with NSBezierPath?

I would like to create a vector object that can be drawn with a pen tablet and will honor the pressure information from the pen (by increasing/decreasing line width appropriately). Now I know how to get the pressure info out of the NSEvent, but of course NSBezierPath doesn't support varying line widths.
So I'm trying to generate a Bezier path that is the outline of my line, by calculating the perpendicular lines at the ends of the curve and connecting those with the very same curve. It nearly works in my little test project for a single curve segment:
https://github.com/uliwitness/WideningBezierPathTest
but this has one big issue: The line thins to barely 2 pixels in the middle (it should only go from 32 to 8). Does anyone know how I'd adjust the control points so the two edges of the line in the curved part are at roughly the same distance ?
Anyone have ideas? Suggestions? Useful articles?
Thanks to suggestions from others I've managed to cobble something together that works. I've committed the changes to the repository, but you can go back a few revisions if you want to see the older code. Here's what I do now:
I flatten the path using bezierPathByFlatteningPath. This gives me straight line segments.
I then calculate the start and end points of the perpendicular lines at the start and end of each line segment (these lines are as long as the line size should be at this point).
I create a bezier path containing a parallelogram consisting of the two perpendicular lines plus lines connecting them. This gives a smooth transition in line widths for each segment.
Once I have the segments, I draw the ending perpendicular lines of the path, plus the sides of each segment (but not the perpendicular lines between segments) into a new bezier path, which I can then fill to draw the stroke with the desired line width variations.
If you want to use this for printing or under HiDPI, you might have to muck with the "flatness" of the bezier path, but for 1x screen display it looks fine.

How can i draw a slanted rectangle in a frame (or picture)?

I have a code that takes a video, split it into frames and then asks me how many rectangles would i like to draw on the frame (only the first frame, kin the code below).
I would like to be able to draw a slanted rectangles too. Is there any command that can help me?
if k==1
result=input('How many rectangles would you like to draw? ');
pos=zeros(result,4);
for i=1:result
handle=imrect;
pos(i,:)=handle.getPosition;
end
end
In your code, imrect is responsible for drawing a rectangle.
You may use impoly to draw some polygons (here slanted rectangles).
The code
imshow('cameraman.tif')
h_poly = impoly;
will give
You can modify the shape by drag/dropping the selection's blue handles.
The positions of the blue handles can be known with
pos = getPosition(h_poly)

Resources