C# CNC CONTROLLER - c#

I am trying to create a C# software that can control the CNC machines, First I am trying to create a 3d Space area in the PictureBox (or Pannel), I have gone through the internet and reached about this and I got one video. He made a 3D place in the form space, and it was a good tutorial but I don't know how to create a coordinate system in that space as you see in the image that I have given below.
Pls, Help me to do this.
enter image description here
enter image description here
If I get the proper solution for this, in the future I can develop this project.
Thank you, guys...
Update:
Actually, I have designed a C# program That controls the CNC machines,
For example, we can take UGS, There is much software out there but I need to create this in C#. The Only thing I am suffering here is the 3D coordinate system. How to create the Axis diagram in 3D.
Example: Planet Cnc's "Cnc USB Controller" I want to create this software in C#.
Thanks...

Build a CNC CAD programmer from skratch it's not a trivial activity.
You should be skilled in:
Math and Geometry in particular (vector/matrix calculus, base transformation, ...)
A language to comunicate with CNC (maybe G Code)
3D file formats
etc.

This is old, and you should have fixed the problem by now... but I hope to help someone in the future.
Have you seen Helix-toolkit? This library provides easy 3D camera and object controls for .Net Framework. I used this library in WPF C# for an application that generated G-Code for a CNC machine... this saved me in the simulation.
You can import 3D models (.3Ds or .obj) from your machine to 3D Panels (HelixViewport3D) and use them in the simulation or create meshes on demand in C#.
The documentation is simple, but on GitHub there are lots of examples.
Helix-toolkit on GitHub

Related

different images from different point of view

I want different images to be displayed from different point of view. For the whole concept explaination please look at the images. they explain my idea/query!
As in the first image you see that there are three people at different angle looking at the monitor. Now i want the webcam to track the eyes and show the particular defined image to the user> For example: If user is at 45 degree angle then show image1.png
Depending upon the user's prespective of watching. The computer should show the image.
(the lady is the game character for representation purpose)
Can you please guide me on what steps can be taken to accomplish this? Is there any plugin available for unity that tracks faces? Please guide me
Also thanks for the compliments on my sketching skills xD
Stackoverflow is not really meant to recommend plugins, since the choice is usually opinion based so there is no exact answer.
That being said, on of the most common used API for computer vision (meaning interpreting images, including face recognition) is OpenCV, so that could be a good start for you to look at that.
And fortunately for you, there is a Unity plugin for OpenCV
It is too broad to give you more details about how it works here. You should try to make it work, and if you have a problem with your code, open a new question with the code portion that you struggle with.
PS: nice sketching skills
Perhaps easier option would be to use Kinect
(trying to detect face or eyes from that far might be shaky?)
With Kinect you can get skeletons for multiple people, and getting the angle between target and those kinect avatars would be easy.
If there is no space to put kinect in good position,
could consider placing it on the ceiling above (and then use depth data only to detect people in its view)
Only issue is that apparently Microsoft has stopped Windows kinect support,
so you would need to find 2nd hand versions.. (Unity Asset store still has some kinect plugins and examples available)
https://www.polygon.com/2018/1/2/16842072/xbox-one-kinect-adapter-out-of-stock-production-ended
Or look for kinect alternatives that work with unity, try RealSense cameras:
https://www.intel.sg/content/www/xa/en/architecture-and-technology/realsense-overview.html

Kinect touchable Surface

I have a programming project using Kinect Xbox one sensor. The project is mainly about turning any surface into an interactive touchable screen. I have collected all the hardware including the projector. In addition, I have done my research and downloaded the related packets such as Visual Studio in order to start coding in C#.
So, my question here:
Is there any any library that I could use which may facilitate me to determine the angles/depth of the surface?
Plus, I don't have a fully vision of the steps which need to be done for the next steps, so I would really appreciate it if there is anyone could draw me a small map for me for this project.
If you have trouble with getting started with kinect go through this
Quick start series
and you also might want to capture the depth of objects. For that try to use Kinect's depth image streams and the sdk itself does not provide much happy methods. You will have to do some image processing on that gray scaled depth stream. Then you can find the edges of a single object in different depths.

Need to use Tiled Map editor with Unity 4.3.4

I shifted to unity few weeks ago. I am developing a 2D platformer. For creating the maps I am using Tiled map editor from www.mapeditor.org . I have created a basic map. Included the tileSheet png and the .tmx file (saved as XML) in the Assets of the project. I am able to read the XML , that is all the gid's. But I don't know how to access a particular portion(tile) from the tileSheet corresponding to a gid.
I think for this I need to load sprite in the memory and select a tile (by specifying Height and width and coords) from texture memory to display it on screen. As given here :http://gamedevelopment.tutsplus.com/tutorials/parsing-and-rendering-tiled-tmx-format-maps-in-your-own-game-engine--gamedev-3104
but its for flash , how I can achieve same thing in Unity using C#. Notice the copyPixel stuff in the flash code. I thought I could use ReadPixels but it is used for reading from screen only not the texture memory.
Thanks.
If you're working in Windows then the Tiled2Unity Utility sounds like it will fit your needs. It exports Object Layers and was made with Unity 4.3 features in mind.
(Full disclosure: I'm the author of Tiled2Unity)
EDIT: Tiled2Unity is available for Mac users as well now. There is a command-line version for Linux users. (all free)
If you can describe more carefully your problem and what you are trying to do, maybe myself or someone can help you better, for example what exactly do you mean by "load a sprite into memory"? Or "select a tile"? Copying pixel data is SLOWWW, and hopefully you don't mean to be doing this in real time.
Here is my real advice though:
Have you checked out UTiled? It does tiled maps in 2D in Unity so I think it already does what you want and it's free.
There is also UniTMX... free.
There is also 'Tiled Tilemaps'... which is like $2.
I also built a system that can also do what I think you are trying to do (your link is broken, so I can't be sure).
The system I built is called 'Tiled to Unity' (you can search it in youtube to see if it does what you want). It allows you to attach gameObjects to tiles and have tile variants, and can do 3D tiles.
Anyway, trying to roll your own pipeline from Tiled into Unity is a ton of work, and with these tools available, I think it is almost certainly unnecessary... That's just imo.

How should I start playing with 3D?

I'm a developer for just about 6 months now, and since I enjoy programming I've started little programs such as encripters, calculators, tools, stuff to play with DropBox (hehe), stuff that play with bitmaps, drawing graphics, and even a program to update the MSN display image according to the artwork of the music you're listening yo on iTunes.
One of my other hobbies is 3d modelling (completely amateur) and I'd like to mix these hobbies together! So I've read a little about it and figured I'd have to have good notions on geometry, math, point spacial position (which I do, from my 3d modelling experience), but I don't know how to use API's for it, so I've 'simulated' simple 3d with a simple program I've made (a spinning cube).
Here are some questions:
1) What would be a nice 3d development tool for a .NET programmer like me?
2) Is there a way of using 3d models made in 3DS Max ? (I intend on modelling characters)
3) What knowledge should I have in order to render it, and move it around ?
4) Which API should I use ?
NOTE: Not a dupe, I'm asking for directions specific for .NET development possibly using 3ds MAX, and there were no questions about it so far
EDIT:
I've got three answers that seem quite nice, so let me specify a little and maybe you can tell me what's the more appropriate tool.
What I'd like to build soon would be like:
portable (click'n'run, no need to install, and (hopefully) no need to send DLL's along)
"3D embedding" in winforms application, like a picturebox you could render in.
Real winforms application-like (having all System api's like IO, Drawing and etc)
The development enviroment would be nice if it:
Had the possibility to import existant 3D models (not a must, but a plus)
Had the ability to create 3d models programatically (a must)
Possibly has a tool for materials and textures (that would be a huge plus)
Is Well known (high availability of tutorials, questions in S.O., forums..)
And it would be really nice if I could use C# all the way :)
I'm going to provide another vote for XNA. The comment that it's too "game centric" is a non-starter - it provides a rendering loop with feedback on how fast everything is running so you can adjust your rendering to try to maintain a specific framerate (if you want). This isn't particularly game-centric as it's something that most 3D applications should worry about. The only thing that's really unusually game-centric about it is that it provides easy access to game controllers. Feel free to ignore that bit if you don't want to use it.
The only downside for you using XNA is your requirement that it be click'n'run, XNA has a redistributable that you have to worry about. Note that Win7 has this installed by default, but Vista and earlier don't.
EDIT:
XNA is made for applications that are strictly 3D. As such it doesn't natively support using typical windowing controls inside of an XNA project. But, there are ways around this...
A few useful links. Embedding XNA in a winform : http://forums.xna.com/forums/p/6471/34180.aspx#34180
WPF controls directly inside an XNA project : http://www.c-sharpcorner.com/UploadFile/iersoy/256/Default.aspx
Personally, I found XNA a little too "Game Centric" for my tastes. I was more interested in design/architecture type uses.
You may find SlimDX more to your liking.
Even though there are great suggestions in this post already(such as SlimDX and XNA), I'd just like to mention OpenTK.
OpenTK is closer to OpenGL than Direct3D, but it might be the best solution for cross-platform 3D .NET applications.
Since you are using C#.Net, the XNA library will be excellent for you. It is free off the Microsoft website and integrates into the VS IDE. A lot of available tutorials around to help get started.
Also, if I remember correctly. to use a 3d model in XNA, simply export the completed model as (.X). It can then be loaded into your work.
I vote you try Blender. www.blender.org
It's free, open source, and has a great community both on forums and IRC. Progress on the app is pushed forward by major community projects every year, some of which are movies and games and have won some awards. It is gaining industry acceptance as a way to model extremely fast.
Downsides: It's not considered as "pro" as Maya or ZBrush, and it has a very different brain about interface. Learning curve can be interesting, depending on how you learn and how much help you receive.
Upsides: It's free, great community, updated regularly, many tutorials and community projects to work on.
Community:
Blender channel on IRC
Blenderartists forums
Previous community Projects:
Elephant's Dream
Big Buck Bunny
My vote goes for Povray. It is a 3d renderer with a c-like syntax language. It doesn't satisfy your .net needs, but if cool non the less for 3d rendering. If you any kind of interactivity XNA is probably your best best. But I'm interested in your finds.
Re: "Has the ability to create 3d models programatically (a must)"
A few pointers:
Polygon Triangulation
(Dr. ?) Jonathan Richard Shewchuk's Triangle library
Dr. Hang Si's TetGen library
Constructive Solid Geometry
GNU Triangulated Surface Library
There are no .NET libraries I am aware of that allow you use the above mentioned libraries/techniques. You will have to use PInvoke or C++/CLI in order to make calls to these libraries from the managed world.

How can I programmatically access the ArcGIS 3D Analyst Toolbar's "Features to 3D" command?

I need to take a 2D shape file in the ".shp" format that ArcGIS accepts, and add 3D information supplied by a raster DEM. I'm looking for how to do this with the ArcObjects API. I'd like to do it in C#, but examples in any .NET language would be welcome. The only thing I've been able to find are descriptions of how to do this manually in one of the ArcGIS desktop apps. Like this helpful HowTo article, or the wonderful full color illustrations on page 22 of this tutorial. That's great and all, but I need to use this feature in the middle of an automated chain of operations. I don't want to have a manual step in the middle.
OK. I figured it out. I'm jotting down an outline of what I did here in case anyone else runs into the same problem.
The key method is ISurface.InterpolateShape. It will copy an existing 2D IGeometry and add 3D information to it from a surface (raster or TIN). I translated this example VB6 code from VB6 to C#, and modified it to call InterpolateShape for each copied IGeometry in the input shape FeatureClass before inserting it into the output FeatureClass.
I won't post any of the code here because I developed it on my company's dime, but this should be enough to figure it out reasonably quickly. Hopefully this will help some other struggling developer get through the problem more quickly.

Categories