Visio (Re)naming shapes as 'sheet' when it should be circle, box, etc - visio

This may seem pretty idiotic, but here goes: I'm making some networks in visio and I'm literally just cutting and pasting boxes and circles (changing the text) over and over again and adding connectors as appropriate. I have a macro that then sorts the shape texts based on whether it is a circle or box.
Every once in a while the macro will fail, not because there is a problem with the macro but because one of my shapes (boxes, circles, and even connectors) have been renamed by visio as a 'sheet'. For example, I copy 'Circle.18' and then paste it right back in, and instead of being 'Circle.19' this shape is 'Sheet.19'. This can happen when I copy & paste, or when I drag a new shape off the stencil. It appears to be totally random when this happens, but it messes up my subsequent macro operation so I would really like to stop visio from naming different shapes as 'sheet.xx'
Any ideas?
Is it possible to change the name of a shape in the shapesheet or anything?
Thanks in advance

I don't know how the naming works in Visio, and I don't rely on the names for macros.
In your case, distinguishing the geometries from one another is how I would identify shapes. So if it's a 2D shape, and it has a geometry section with 6 rows, it's probably a rectangle. If the geometry section has 2 rows, it's probably a circle.
However, I wouldn't necessarily let it get to the point where I'm going off of the shape geometry, unless I want whoever is using the macro to use whatever circle or box shapes they want. Instead, I would just provide a stencil with a box and a circle shape, and I would either put the different shapes on different layers, or just add a user cell with the type clearly defined. Then the macro would just look for those shapes specifically denoted as the type I'm interested in.

Related

Overlapping Polygon Outline in Openscad

I am totally new to openscad.
I am trying to generate two overlapping polygons (2D). I would just like to observe the outlines of both shapes at the same time.
I have managed to generate two different shapes. Although the shapes overlap, the renderer appears to show the outline of the combined shape with the inner part is filled in with colour.
How might I achieve my goal if the shapes were simply two overlapping squares?
I would be glad to see your code to understand exactly what you're trying to describe.
In any case, you must know first that openscad have several rendering types:
the f5 one is the quicker and doesn't really calculates the final result, only its image on the screen (that's why you cannot export with it)
the f6 one which does all the calculation of the points of the mesh and then render it (that's what you do to export)
the debug ones that are similar to f5
I think f5 could be your solution but it will look a bit "glitchy" because of the superposition of the two shapes. The fact is that I don't think openscad is made for what you want to do because you can consider that all that you put in your script is in a big union() block so when you press f6 all the independent shapes are combined into one and I don't think there is a way to prevent that. I should add that I think that the 2D functions of openscad are probably made to be used with the extrude functions to make 3D volumes for which the overlapping doesn't have a lot of sense.

Adjacent irregularly shaped images

Is it possible to have irregularly shaped images positioned adjacent to each other, where each individual image is clickable within its own boundaries?
For example, if I had a map of the US and I want to click each state and have a separate segue for each:
(https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Map_of_USA_with_state_names.svg/2000px-Map_of_USA_with_state_names.svg.png)
I appreciate any tips/pointers in the right direction. Thanks!
Whether the map is really a bunch of irregularly shaped images, or just one image, is immaterial. (The latter will be easier.) You can just define a separate UIBezierPath objects that outline each of the states, and then you can use the UIBezierPath method containsPoint to determine whether some tap point is contained within the respective state.
Frankly, you might consider how much accuracy you really need. For example, if looking at map of US from continental scale, you really don't need extremely accurate bezier paths. Often a simple irregular polygon shape can approximate the boundaries and is more than sufficient for hit tests.
In fact, you sometimes deliberately use a much bigger bezier path. For example, you might draw a single path that goes around all of the Hawaiian islands, with some leeway, so that you don't have to tap right on the actual island, but just somewhere close. Or, for Rhode Island, you might allow a tap on the text "Rhode Island", as well as the state itself.

Shape storage with postgres

I am dealing with storage of shapes. After a day spent to include the routines now I have some doubts.
The main trouble is recognize perfectly the new shape and know if already included or not.
I wrote something, and it works. I select all the shapes with same area and same number of vertex, and than I perform an Heuristic comparison. But, so just to be sure, I would ask you, if you know some direct algorithms, such matrix, spectrum, G theorm that gave two set of point can understand if the two sets are the same shape?
Before somebody screams about gis, the shapes can contain negatives shapes, better known with the name of holes. That are not to analyze in own coordinate system but in owner shape coord sys, where is the hole inside the other shape and his orientation. As far as I know, can gis nest shapes in other shapes and recognize them as whole shape.
Second place, what is the best way to store shape? I was thinking to store as array but I find it uncomfortable.

Automated placement of points/landmarks on shape outline using MATLAB

I'm just beginning with Image analysis in MATLAB.
My goal is to do an automated image segmention on images of plant leaves.
I have had reasonable success here thanks to multiple online resources.
The current objective, the reason why I'm placing this question here, is to able to place 25 equidistant points along each half of the margin/outline of leaf, like described in following image:
For the script to be able to recognize each half of the leaf, user can put two points within the GUI. One of these user-defined points will be on the base of leaf and the other on tip of leaf. It would be even better if a script would be able to automatically recognize these two features of the leaf.
For the output, I would like a plain text format file containing image coordinate of each point.
I'm not asking for a ready made script here, but looking for a starting point.
One way I think this can be done is by linearizing/open up the outline in such a way that it becomes a straight line. This can be done by treating any of user placed point/landmark as breakpoint. Once a linear outline is obtained it can again be broken into two halves at other user defined point and now points can be placed. One point to bear in mind here is that the placement of points for each half should start from the end that corresponds to the same breakpoint/user-defined point in each half. Now these straight lines can be superimposed on original image for reconstruction.
Thank you very much.
Parashar

Identify different shapes drawn using UIBezierPath?

I am able to draw shapes using the UIBezierPath object. Now I want to identify different shapes drawn using this eg. Rectangle , Square , Triangle , Circle etc. Then next thing I want to do is that user should be able to select a particular shape and should be able to move the whole shape to different location on the screen. The actual requirement is even more complex , but If I could make this much then I can work out on the rest.
Any suggestion or links or points on how do I start with this is welcome . I am thinking of writing a separate view to handle every shape but not getting how do I do that..
Thank You all in advance !!
I recommend David Gelphman’s Programming with Quartz.
In his chapter “Drawing with Paths” he has a section on “Path Construction Primitives” which provides a crossroads:
If you use CGContextAddLineToPoint your user could make straight lines defined by known Cartesian points. You would use basic math to deduce the geometric shapes defined by those points.
If you use CGContextAddCurveToPoint your user could make curved lines defined by known points, and I’m pretty sure that those lines would run through the points, so you could still use basic math to determine at least an approximation of the types of shapes formed.
But if you use CGContextAddQuadCurveToPoint, the points define a framework outside of the drawn curve. You’d need more advanced math to determine the shapes formed by curves along tangents.
Gelphman also discusses “Path Utility Functions,” like getting a bounding box and checking whether a given point is inside the path.
As for moving the completed paths, I think you would use CGContextTranslateCTM.