3D view in Ignition

I need to replace a Siemens WinCC SCADA on one production line.
There’s no problem with that and I’m almost finished, except for one part:

Inside the production line, there’s a pipe bending machine for which there is a separate, custom/proprietary software installed (with no source code) on the Panel PC, besides WinCC Runtime.
The software is used for creating/configuring pipe shapes.

Basically, operator inserts steps, necessary for creating required pipe shape and the program draws the shape of the pipe on the screen.

And that 3D view is what I have the problem with…

This 3D view is ONLY for visualization of the pipe. All calculations for servo motors (3 axes), necessary for bending are done in the PLC. The software only transfers the angles, speeds, lengths,… in steps (these are basically recipes) to the PLC and PLC is doing CNC calculations.

The program is written in .NET C# (MS Visual Studio) and was successful in decompiling it, to see, what is going inside.
It uses the .NET component from Exeshot (https://www.devdept.com/).

Now, I’ve succeeded in doing everything in Igniton, except for showing the 3D view of the pipe.

Is there any way that I can show something similar in Ignition? It doesn’t need to be so fancy with all the shadows and lighting… just some basic 3D pipe shape, which it doesn’t even need to rotate in the view, like in the original software.

I was looking on the internet for something like Java 3D library and everything out there requires good Java programming skills, which nobody in our company has.

We are willing to pay if anyone is willing to bite into this apple and provide us with a satisfactory solution.
I can provide the software on the picture if necessary and any other info if required.

EDIT: Oh, and the timeline for this is beginning of May 2018 (the holidays).

1 Like

This has been done in Ignition via JavaFX – Lafarge was a Gold Firebrand award winner at the 2015 Ignition Community Conference. They’d be the ones to talk to.

1 Like

Thank’s for the info.
But I don’t think that I need such a complex solution.
I was thinking about more simple approach like this, maybe:
I like the first approach, but like I said before, it’s pure java and that is to much for me and my old brain cells…
Maybe somebody can port this to Paintable Canvas in Ignition, if it’s possible?
DemoViewer.zip (2.5 KB)

Can you upload a sample file of a pipe?

What do you mean ‘sample file of pipe’?
There are no sample files of pipes…

Here is a sample project.
CanvasSample.proj (23.4 KB)


Thank you very much! :clap: :+1:

Has anyone developed 3D data import for this? Scene graph import?

re: data import

Turns out to be fairly easy to import IndexedFaceSet data from VRML (WRL text export from SolidWorks). By abusing the Documentation attribute of a memory tag to store the VRML, the following code parses the IFS’s into arrays using regular expressions:

tagPath = "VRML/model.Documentation"
qV = system.tag.read(tagPath)
import re
reIFS = r'Separator\s*{\s*\w+[^}]+}\s*\w+\s*{\s*ambientColor\s*\[\s*([\W\d]+)\][^}]+}\s*Coordinate3\s*{\s*point\s*\[\s*([\W\d]+)\]\s*}\s*IndexedFaceSet\s*{\s*coordIndex\s*\[\s*([\W\d]+)\]'
reXYZ = r'([-+]?[0-9]*\.?[0-9]+)\s+([-+]?[0-9]*\.?[0-9]+)\s+([-+]?[0-9]*\.?[0-9]+)'
reIdx = r'([-+]?[0-9]+)\s*,\s*([-+]?[0-9]+)\s*,\s*([-+]?[0-9]+)\s*,\s*-1'
matches = re.findall(reIFS, qV.value)
colors	=  [ map(float,					   re.findall(reXYZ,matches[k][0])[0])	for k in range(len(matches))]
vertices = [[map(float,tuple) for tuple in re.findall(reXYZ,matches[k][1])]		for k in range(len(matches))]
indices	 = [[map(int,  tuple) for tuple in re.findall(reIdx,matches[k][2])]		for k in range(len(matches))]

And then if you use the python classes defined in the example code, build the list of triangles:

tris = [Triangle(*[Vertex(*vertices[fs][k]) for k in indices[fs][f]]+[Color(*colors[fs])]) for fs in range(len(colors)) for f in range(len(indices[fs]))]

Finally here are the custom python classes tuned using list comprehensions:

	class Vertex:
		x = 0.0
		y = 0.0
		z = 0.0
		def __init__(self,x,y,z):
			self.x = x
			self.y = y
			self.z = z
	class Triangle:
		v1 = None
		v2 = None
		v3 = None
		color = None
		def __init__(self, v1, v2, v3, color):
			self.v1 = v1
			self.v2 = v2
			self.v3 = v3
			self.color = color
	class Matrix3:
		values = []
		def __init__(self,values):
			self.values = values
		def multiply(self,other):
			return Matrix3([sum([self.values[3*i+k]*other.values[j+3*k] for k in range(3)]) for i in range(3) for j in range(3)])
		def transform(self,vertex):
			vec = [vertex.x, vertex.y, vertex.z]
			return Vertex(*[sum([vec[j]*self.values[i+3*j] for j in range(3)]) for i in range(3)])
1 Like