shape

How to Calculate Centroid in python

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 05:59:17
问题 I'm beginner to python coding. I'm working over structural coordinates. I have pdb structure which have xyz coordinate information (last three col) ATOM 1 N SER A 1 27.130 7.770 34.390 ATOM 2 1H SER A 1 27.990 7.760 34.930 ATOM 3 2H SER A 1 27.160 6.960 33.790 ATOM 4 3H SER A 1 27.170 8.580 33.790 ATOM 5 CA SER A 1 25.940 7.780 35.250 ATOM 6 CB SER A 1 25.980 9.090 36.020 ATOM 7 OG SER A 1 26.740 10.100 35.320 ATOM 8 HG SER A 1 26.750 10.940 35.860 ATOM 9 C SER A 1 24.640 7.790 34.460 ATOM 10

Drawing a rectangle inside a 2D numpy array

核能气质少年 提交于 2019-12-18 05:59:09
问题 I have a 2D numpy array containing the individual data from each pixel of a sensor. The image is displayed in a GUI with a live feed from the camera. I want to be able to draw a rectangle over the image in order to distinguish an area of the screen. It seems pretty simple to draw a rectangle which is parallel to the side of the image but I eventually want to be able to rotate the rectangle. How will I know which pixels the rectangle covers when it is rotated? 回答1: You can use the Python

Link cell with Excel Shape

家住魔仙堡 提交于 2019-12-18 05:06:09
问题 In excel, we insert a shape, and we can link it to a cells value, by selecting shape and typing the cell reference in formula bar. I want to know: How can we do that programmatically. Like For Each shape As Excel.Shape In workshet.Shapes 'is there something like shape.Formula or any method from which I can do the above task. Next Here is what I want to do programmatically It's been days now , I am searching it. Really Need help, Thanks Alot. 回答1: You don't need to use Select to apply formulas

Cutting a multipoint ploygon out of Bitmap and placing it on transparency

倾然丶 夕夏残阳落幕 提交于 2019-12-18 02:58:08
问题 I have a bitmap out of which I'm cutting out a multipi point polygon. I'm curious what the correct process is for taking the pixels within the arbitrary shape and copying them onto a new bitmap where the rest of the pixels are transparent. The objective is to allow the user to trace the shape and then remove everything outside the polygon. I have the polygon part worked out (as a an array of points), but now am stumped as to how to transfer just the selected pixels to a new Bitmap. TIA 回答1:

How to draw filled triangle on android Canvas

有些话、适合烂在心里 提交于 2019-12-17 18:50:34
问题 I have class MyView that extends View class. MyView should draw filled triangle. I drew a triangle but I cannot get it filled. This is my onDraw() method: @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.BLACK); canvas.drawPaint(paint); paint.setStrokeWidth(4); paint.setColor(android.graphics.Color.RED); paint.setStyle(Paint.Style.FILL_AND_STROKE); paint.setAntiAlias(true); Point a = new Point(0, 0); Point

Convert Shape into reusable Geometry in WPF

僤鯓⒐⒋嵵緔 提交于 2019-12-17 17:05:34
问题 I am trying to convert a System.Windows.Shapes.Shape object into a System.Windows.Media.Geometry object. With the Geometry object, I am going to render it multiple times with a custom graph control depending on a set of data points. This requires that each instance of the Geometry object has a unique TranslateTransform object. Now, I am approaching the issue in two different ways, but neither seems to be working correctly. My custom control uses the following code in order to draw the

determine if a point sits inside an arbitrary shape?

你说的曾经没有我的故事 提交于 2019-12-17 16:15:53
问题 Given a point's coordinates, how can I determine if it is within an arbitrary shape? The shape is defined by an array of points, I do not know where the shape is 'closed', the part I really need help is to work out where the shape is closed. Here's an image to illustrate what I mean a little better: 回答1: Easiest way to do it is cast a ray from that point and count how many times it crosses the boundary. If it is odd, the point is inside, even the point is outside. Wiki: http://en.wikipedia

I need to change the stroke color to a user defined color. Nothing to do with the state

落爺英雄遲暮 提交于 2019-12-17 15:15:30
问题 I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to use the XML file.... but that doesnt let me make it dynamic. Thank you for any help! I need to change the stroke color to a user defined color. Nothing to do with the state. <

Half circle shape not work

时光总嘲笑我的痴心妄想 提交于 2019-12-17 10:25:32
问题 I try to create half circle background, in development IDE preview it works, but when I launch in emulator it doesn't work. Here is my shape code : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:height="50dp"> <shape> <solid android:color="@color/colorAccentDark" /> </shape> </item> <item android:top="-500dp" android:bottom="0dp" android:left="-100dp" android:right="-100dp"> <shape> <corners android:radius="500dp" /

Android different EditText backgrounds for different states using shapes, selector or list

不想你离开。 提交于 2019-12-17 07:48:27
问题 I'm starting a new app where I use ActionBarSherlock & HoloEverywhereLib. My min & target SDK are the same (10/2.3.3). This is just so I can also quickly port it to Amazon Kindle & BB10 using the android runtime they have (already used this setup for another app and it worked without issue). All the while the app should have as close to ICS/JB look as possible. For my EditTexts though, I'm giving them a Girgerbread/iOS (round corners, but no shadows) look to them Someone mentioned to me a few