shapes

How to compare two shapes?

╄→гoц情女王★ 提交于 2019-12-17 05:12:34
问题 Is there a way to compare two geometric shapes (or any two more generic data structures), without using the brute force when a tolerance is involved? The brute force (that is comparing each value of each object against each value of the other object) works but it's slow, and I can't use it. I tried sorting the data and comparing two sorted collections. It's fast, but it only works with zero tolerance. As soon as I add the tolerance I get lost. The problem is that two values can be identical

How to compare two shapes?

南笙酒味 提交于 2019-12-17 05:12:10
问题 Is there a way to compare two geometric shapes (or any two more generic data structures), without using the brute force when a tolerance is involved? The brute force (that is comparing each value of each object against each value of the other object) works but it's slow, and I can't use it. I tried sorting the data and comparing two sorted collections. It's fast, but it only works with zero tolerance. As soon as I add the tolerance I get lost. The problem is that two values can be identical

Two Rectangles intersection

爱⌒轻易说出口 提交于 2019-12-17 04:59:15
问题 I have two rectangles characterized by 4 values each : Left position X , top position Y , width W and height H : X1, Y1, H1, W1 X2, Y2, H2, W2 Rectangles are not rotated, like so: +--------------------> X axis | | (X,Y) (X+W, Y) | +--------------+ | | | | | | | | | | +--------------+ v (X, Y+H) (X+W,Y+H) Y axis What is the best solution to determine whether the intersection of the two rectangles is empty or not? 回答1: if (X1+W1<X2 or X2+W2<X1 or Y1+H1<Y2 or Y2+H2<Y1): Intersection = Empty else

Multi-gradient shapes

拟墨画扇 提交于 2019-12-17 00:22:30
问题 I'd like to create a shape that's like the following image: Notice the top half gradients from color 1 to color 2, but theres a bottom half that gradients from color 3 to color 4. I know how to make a shape with a single gradient, but I'm not sure how to split a shape into two halves and make 1 shape with 2 different gradients. Any ideas? 回答1: I don't think you can do this in XML (at least not in Android), but I've found a good solution posted here that looks like it'd be a great help!

How to get Shape's internal name in Excel

两盒软妹~` 提交于 2019-12-14 04:16:58
问题 When a picture is inserted into an Excel worksheet using Shapes.AddPicture(...) method, Excel gives it a name "Picture 1", "Picture 2" etc automatically. This name can be used to get a reference to this shape object in Shapes collection like Shapes.Item("Picture 1"). If the name is changed in Excel using the Name Box, there are two different names (or one of them is a key/Caption) through which the Shape object can be referenced. So if I change the name to "MyPic" I can use any of these to

Morph a retangler view into a circle [closed]

谁都会走 提交于 2019-12-14 02:13:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am trying to animate/morph a rectangular view/layout, as all views are rectangular. The user case for this would be: The user long-clicks a view that contains an ImageView or just the main view with a background, a new view would be generated being the size of the screen, then this view would shrink into a

Can you select a shape directly, if you know its topleftcell row & column

时间秒杀一切 提交于 2019-12-14 02:10:02
问题 I have approx. 100 rectangles on a sheet. I want to change the color of a particular rectangle for which I know its TopLeftCell co-ordinates. I want to be able to directly select this rectangle to change its color, but I cannot find any VBA code to do this. Currently, the only code I can find, selects all shapes on the sheet, and then looks for an intersection of each of the shapes on the sheet with the TopLeftCell , to then select that rectangle to change its color. With maybe 100 shapes to

Rectangle Class for BlueJ

左心房为你撑大大i 提交于 2019-12-13 22:11:20
问题 I am trying to write code for a rectangle class in BlueJ. When I compile my code I get the error "constructor Rectangle in class Rectangle cannot be applied to given types; required: no arguments; found: int, int, int, int; reason: actual and formal argument list differ in length". Also, I am confused on where to put the formula for a rectangle - width x height. I am trying to create class called rectangle that I could use in another class called picture. I am trying to use this class to make

Scale a Bezier Curve Proportionally - calculate control points

孤街浪徒 提交于 2019-12-13 18:26:43
问题 I'm trying to take a bezier curve (any arbitrary curve in Core Graphics) and shrink (or expand) it proportionally given another two end points. I have an approach that sort of works, but it ends up 'flattening' out the curves, and not retaining the shape exactly. Maybe I've messed up the code or logic, but I have the two original points along with the control point(s). Given another set of end points I want to calculate the appropriate control points to produce the same shape between the new

How do I group a set of shapes programmatically in excel 2007 vba?

混江龙づ霸主 提交于 2019-12-13 12:07:49
问题 I am iterating over data on the Electrical Tables sheet and creating shapes on a Shape sheet. Once the shapes are created I would like to programmatically group them. However I can't figure out the right syntax. The shapes are there, selected, and if I click the group button, they group perfectly. However with the following code I get Runtime Error 438 Object does not support this method or property. I am basing this code on vba examples off the web - I am not a strong vba programmer. What is