Pipeline Isometric Drawing Program
Blitz3D Forums/Blitz3D Beginners Area/Pipeline Isometric Drawing Program
| ||
Hi, I am new to programming and am wanting to write a program that will produce an isometric representation of a 3D pipeline. I can get the make up of the pipeline from CADDS5 in the format:- (itemdesc)(PC1=1452 320 -56)(PC2=-45 254 -1051) (PP=-754 280 -521) where itemdesc is the item description EG Tube,Tee,coupling etc. PC1 is the start point of this section. PC2 is the end point of this section and PP is the placement point. From this data I want to create a isometric drawing with measurements against the lines drawn. So where do I start or should I learn to dribble before I run? |
| ||
? I can get the make up of the pipeline from CADDS5 What is CADDS5 ??? PC1=1452 320 -56)(PC2=-45 254 -1051) (PP=-754 280 -521) What are these number for ???? PC1 is the start point of this section Which section are you talking about ? What is PC1 ????????????? I guess PC1, PC2, PC refers to 3D coordinates from where to draw the pipeline ? Could you be more specific ? . should I learn to dribble before I run? I think you should learn to describe your goal, before to even enter in the soccer field. ;-) Sergio. |
| ||
Semar, I am sorry for my incoherant babble. I will try to clarify a few points. Firstly CADDS5 is a 3D CAD package, This is used to generate 3D models of objects. The object could be a simple lightbulb or a full 3D model of a submarine. Secondly the PC1,PC2 and PP are all points in 3D space as CADDS5 traces along the pipeline, Imagine the cold water pipe in your house. It will enter your house from outside and then make its way to all the Taps/Faucets and other water outlets. It will take the form of lengths of tube/pipe connected to bends/elbows and tap/faucet connectors. Each section( tube/pipe bend/elbow connector) will have a PC1( start point XYZ), PC2( End point XYZ) and a PP( placement point XYZ). What I am wanting to do is take the 3D geometry from the CAD package and generate a 2D( Isometric ) drawing of the pipeline which can be used to manufacture the pipeline. This has been done a few times already with products like IsoGen but after looking at the quality of the output drawings I was hoping to be able to produce a better solution using Blitz3D. I hope the above has clarified my first attempt at getting my problem over to all you clever BB3D people. Lee. |
| ||
Thanks Lee for clarification. :) So basically you need to convert the PC1,PC2,PP 3D coordinates, in a 2D system coordinates, if I'm getting right your concept. I assume you already know that in 3D you can also have an 'ortographic' view; this is achieved by setting a flag with the CameraProjMode command: CameraProjMode camera,mode Parameters: camera - camera handle mode - projection mode: 0: no projection - disables camera (faster than HideEntity) 1: perspective projection (default) 2: orthographic projection Anyway, if you want to stick to 2D, then I guess the only way is to understand the unit measurement of your CAD, and make the appropriate converter to show the pipeline in 2D view. Hum... I guess I was not of a very help for you; anyway, feel free to ask, I'll be more than happy to give you some snippet if you fancy. Good luck, Sergio. |
| ||
Sergio, Thanks for the info. I had a luck at the snippet of code given as an example for the CameraProjMode but when i run the code all i get is a Function not found error???. Lee. |
| ||
I think you need to update your version of B3D. If I recall the orthographic projection mode wasn't added until fairly recently...don't remember which version. Check the version information in you app against the info on version updates. M |
| ||
mearrin69, This copy is just out of the box. when doing the upgrades do I have to do each one or will the latest update cover everything? Lee |
| ||
The latest update covers everything. Sergio. |
| ||
Yep. Just get 1.83. Been using it for a while now with no troubles - seems stable and includes all features since yours. |
| ||
Thanks for the help. Lee. |
| ||
I had to remind myself of what "isometric" meant. You want to take pipeline data and render an engineering drawing from it, where you have two 2D views of the object as seen from 90 degrees separation, and then have a projectecd view where the lines are extended from the two opbjects to project a 45 degree rotated view that appears as something akin to 3D as viewed on a flat surface, without perspective. This drawing would be sufficiently detailed so that a machinist could manufacture the part to the exact dimensions, and the semi-3D projection confirms the manner in which the item is to be cut, bored, drilled, and threaded, and that all essential factors in the two original views are accounted for. In other words, you want to create an Engineering Draftsman program, but one specific to the pipeline industry. There are a couple of things to contemplate here. First, since paper limits you to 2D images, you might want to consider making the extended view a 3D rotatable - while it is on the screen, you can extend it to be viewed from any angle, side, or distance -- even to "passing through" a part of the image. You could also consider creating the illusion of a solid instead of a mere object outline. That would certainly allow a better "view" of the object. Second, you might want to consider how you are going to take this awesome effort and render it into the real world. Are you going to try for a standard print job, or are you going to want to send it to a plotter? Or possibly, you might want to delve into robotic languages and learn how to produce tooling instructions to drive the machines directly? As to the output of a CAD program, it looks like you have to figure out what that cryptic code means, and write your own processes to convert it into 2D or 3D coordinate information. I would not consider that a trivial task in and of itself, but that would be crucial for making this project even do-able. Looks like a major challenge. But don't be discouraged. Any significant effort requires understanding your reach and going at it in a manner that fits with your ability. Programming is as much about learning as it is about about actually doing. |
| ||
Oldefoxx, You are correct that is what I would like to do. I can get the XYZ information from CADDS in a text file along the lines of:- [PIPEPARTS] (ID=00000001) (cpc=123456)(type=PIPE)(PC1=400 0 0)(PC2=800 0 0)(PP=600 0 0) (ID=00000002)(CPC=7891011)(type=FLANGE)(PC1=400 0 0)(PC2=450 0 0)(PP=425 0 0) (ID=00000003)(CPC=7891011)(type=FLANGE)(PC1=800 0 0)(PC2=850 0 0)(PP=825 0 0) [CONNECTS] (00000002=PC1)(00000001=PC1)(type=2) (00000001=PC2)(00000003=PC1)(type=2) From the above data you can see that the pipe is made up of 3 items, 1 bit of pipe and 2 flanges. The pipe is starting from 400 0 0 and ending at 800 0 0 and there is a flange on each end. So I can get all the data I would need from CADDS but it is working out what to do with it in B3D. I should be able to read the file into a TYPE variable and then use it to produce the drawing( outputting to HPGL2 would be nice ). I am having big problems finding any good material on the internet that would give me the understanding of isometric projection that i require. Are there any good books that would help me? Lee. |
| ||
Actually, No. If you frequent old book stores, as I often do, you will find many Engineering Drawing textbooks that go begging for owners. The fine art of representing physical dimensions and properties as part of a software package has led to a sizeable market for such software, and that has resulted in a proprietary effort to control the algorythms and data formats being used. The fact that some formats have become the default standard for the industry is a testimonly to their success and dominence, and the equal success that others have reversed engineered their efforts and created compatable formats and processes. Software producers want to sell you their products, not help you to write a competing product, so there are few such books available, and the prices can run three to five times what other technical books might bring. Actually, learning to do graphics in 2D or 3D would be a good grounding in the principles involved. And there are books for that, and they are not terribly expensive. But many people learn it by playing with sample code and seeing how actual code works. It is a method that works. In fact I rarely buy a computer book that does not come with sample code on a CD, as it is a very effective way to delve into a topic, even to find an effect that you were not previously aware of. As to processing the data from CADD, I would suggest that you read it into strings, then parse the string using the INSTR() and MID$() functions to break it into substrings, and then you have to option of putting the substrings into fields in TYPE structures, or into their own array strings, or whatever you choose to do. But if you are asking how you then convert that data into XYZ coordinate space, that is something you have to work out. For instance, you say the pipe is starting from 400 0 0 and ending at 800 0 0. Exactly what does that infer? Can that be rendered into an internal/external cross-section, or does it indicate the degree of hardness involved, or the material that it is made out of, or the degree that the material is permeasble? If a dimension, then you should be able to show that in crossection. the outer diameter would be x1", and the inner diameter would be x2". You should be able to set a center point and draw two circles. one with a radius of x1/2, and the other with a radius of x2/2. You would then probably want to do a fill of the area between the two circles, so that it appears to be a solid. In drafting, this is usually done with hatch or diagonal lines, so you have to decide if that is what you want the effect to be instead of just a solid. If you insist on duplicating the artifacts that were adopted by human drafters, then you will have to figure out how to draw line segments that range from the inner rim to the outer rim at a diagonal around the whole of the two circles. You have to decide if the fill or hatch lines are to be in color, made bold or light, and how they would display on the screen and if rendered to a black-and-white plotter, or to a colored inkjet. And that is just for doing a pipe cross-section. You solve that problem, then there will be another, like showing a pipe in profile, where the inner surface is shown as a set of parallel dotted lines. and the outer surface is show as a pair of solid parallel lines. Do you also produce the solid fill between them, or do you again use the hatch technique? How do you indicate that the area between the inner and outer surfaces is actually hidden? Do you do it in a lighter color, or do you make the hatch lines into a series of dotted lines? Programming is all about subdividing a process, determining what key factors are involved, what key decisions have to be made, then what steps have to be incorporated into your program to give a meaningful result. The ease with which you can produce a program depends in part on what the programming language allows you to do most easily, and to what extent you change your approach to accomodate the language and its limitations or assumptions. I can draw a circle on a piece of paper. You ask me how big it is. I ask you how big you want it to be. You say you want it six inches in diameter. I put an arrowed line across the center and write 6". That makes it a six-inch diameter circult, regardless of what size it really is on the paper. I draw another circule on the paper. It looks pretty much like the first circle. You ask me how big it is. I ask you how big you want it to be. You say three inches in diameter. A draw an arrowed line across the center and lable it 3". You say that it isn't 3 inches, because it obviously isn't half the size of the first circle. I say it is 3 inches, because I labelled it that way - it just isn't to scale. But actually, neither was the first circle, since that was not a requirement. When you talk XYZ coordinates, you normally are talking to scale -- that is x's relationship to y is 1:1 and if Z is also a dimension, then the relationship would be 1:1:1. But this is not an absolute. When drawing in a dimension that exceeds the medium (goes off the page), we normally show the extended length as severed, cut, or fractured, and just the significant portions of each end. And we append an arrowed line with the actual length indicated. These methods to accomodate overly long, high, or wide structures have led to some artifacts to make it possible to limit their representation to only a comparatively few sheets of paper. In computer space, XYZ can be anything you want them to be. You pick your scale. And objects can be extended almost to infinity (or to the limits of our ability to represent them numerically) in any direction. How do you want to deal with that? Again, these are key issues to address when designing your program. My concern here is that an isometric drafting package is somewhat dated as a concept today. There may be plenty of people that could relate to it and might use it, but it is of less utility than a modern CADD program. Conceivably, rather than render the output in the form of a isometric view, you could render it into a series of detailed steps for a pipefitter to use in constructing the assembly. Or it could be parsed into a series of precut pipes for use in the assembly. And in CADD form, the pipefitter could access it through a computer, rotate it, check measurments right off the CADD image, and gain a much better feel for what the finished product is suppost to look like. In the final analysis, the output could serve as the source of a series of robotic tool steps to create a finished product. So while I don't ever want to discourage anyone from turning their interest towards the area of programming and getting a computer to do more for them, you have to consider whether you are likely to succeed in your original goals, and whether the return will beneficial enought to justify the effort. For major projects, programmers should look to possible spin-offs (skills gained, related fields for future efforts, other intangeables) or to producing a commercially viable product (make your fortune by marketing your program if it pans out). |
| ||
Hhhmmm, Lots to think about. I think I will still plod on and see what I can achieve. This subject has come to my attension due to the fact that I am testing some software that creates manufacture isometric from the cadds three D model. The company i work for is about to spend upwards of £250,000 on this solution and no doubt we will still have to mess around clearing up the final drawings prior to release to manufacture. Thanks for you help/insight Lee. |