00:20.51 |
*** join/#brlcad CIA-2
(~CIA@flapjack.navi.cx) |
01:06.40 |
*** join/#brlcad cad185
(~181043d9@bz.bzflag.bz) |
01:27.46 |
*** join/#brlcad macTRON
(~18cfd6ee@bz.bzflag.bz) |
01:29.44 |
macTRON |
Is this thing on? |
01:30.16 |
macTRON |
Um . . . I have a question or two about
brlcad |
01:44.23 |
*** join/#brlcad PhantomBantam
(~phantomba@dialup-4.238.67.205.Dial1.Providence1.Level3.net) |
01:59.16 |
learner |
PhantomBantam, what do you mean? |
01:59.42 |
learner |
you provide a datafile that consists of height
values |
02:00.13 |
learner |
it's basically what most packages would call a
"height field" used for modeling terrain, for example |
02:00.51 |
PhantomBantam |
So, all that file is is plain text file with
numbers? |
02:01.22 |
learner |
no, it's a binary data file that it's
expecting |
02:02.01 |
learner |
do you have an existing data set? |
02:02.10 |
learner |
or are you looking for something
auto-generated? |
02:02.19 |
PhantomBantam |
No. |
02:02.38 |
PhantomBantam |
Yes, I am looking for something
autogenerated. |
02:02.39 |
learner |
it's not too difficult to take an existing
binary data, like an image, and convert it |
02:02.51 |
learner |
ahh, okay -- probably even easier |
02:04.14 |
learner |
lemme see if we have a prog that already does
that |
02:04.17 |
PhantomBantam |
What kind of image? |
02:04.24 |
PhantomBantam |
Okay. |
02:41.00 |
*** join/#brlcad CIA-3
(~CIA@flapjack.navi.cx) |
02:50.24 |
learner |
PhantomBantam, sorry for the delay, got
sidetracked fixing a bug |
02:51.09 |
learner |
I don't see a random dataset generator.. the
closest is a procedural database, but that generates a spline
terrain field |
02:51.22 |
learner |
(src/proc-db/terrain) |
02:57.35 |
PhantomBantam |
Okay, I'll give it a shot. |
02:57.46 |
PhantomBantam |
thanks |
02:57.48 |
learner |
that said, let's say you have a png image of
terrain data |
02:58.28 |
learner |
like, http://ftp.brlcad.org/tmp/terrain.png |
02:59.08 |
learner |
to make that into a 3D height field in mged,
you have to convert the file into the format needed which is
network unsigned short |
02:59.44 |
learner |
png-pix terrain.png | pix-bw
terrain.bw |
03:00.13 |
learner |
that converts the png into a raw black and
white image datafile |
03:00.30 |
learner |
then to convert it to dsp data, you can use
brl-cad's cv command: |
03:00.50 |
learner |
cv uc nus terrain.bw terrain.data |
03:01.07 |
learner |
that terrain.data is now ready for import into
mged as a dsp |
03:02.17 |
learner |
at the mged command prompt type the "in"
command, and it will prompt you |
03:02.38 |
learner |
mged> in |
03:02.56 |
learner |
Enter name of solid: terrain |
03:03.02 |
learner |
Enter solid type: dsp |
03:03.18 |
learner |
Take data from file or database binary object
[f|o]: f |
03:03.29 |
learner |
Enter name of file/object:
terrain.data |
03:03.34 |
learner |
Enter width..: 512 |
03:03.38 |
learner |
Enter height...: 512 |
03:03.46 |
learner |
Interpolation: 1 |
03:04.13 |
learner |
Cut direction [ad|lR|Lr]: ad (doesn't
matter much most of the time) |
03:04.33 |
learner |
Cell size: 1000 (1 meter per grid
cell) |
03:05.02 |
learner |
Unit elevation: 500 (smaller is flat
terrain, larger is mountainous) |
03:05.36 |
learner |
e terrain and you should see it show up in
all it's glory |
03:07.34 |
PhantomBantam |
I'll try. |
03:28.25 |
*** join/#brlcad PhantomBantam
(~phantomba@dialup-4.238.67.177.Dial1.Providence1.Level3.net) |
03:28.52 |
PhantomBantam |
Sorry, I was disconnected for some
reason. |
03:29.06 |
learner |
no problem |
03:29.08 |
learner |
any luck? |
03:31.09 |
learner |
let me know if you need me to repost any of
the walkthrough again |
03:32.54 |
PhantomBantam |
No, it's still on the screen. |
03:36.18 |
PhantomBantam |
$ png-pix ~/desktop/terrain.png |
03:36.19 |
PhantomBantam |
-bash: png-pix: command not found |
03:36.19 |
PhantomBantam |
Computer:~ PB$ /usr/brlcad/bin/png-pix
~/desktop/terrain.png |
03:36.19 |
PhantomBantam |
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????}}? |
03:37.07 |
PhantomBantam |
That's what I get when I try to use the
png-pix. |
03:37.24 |
learner |
er, how do you normally run mged? |
03:37.43 |
learner |
you type /usr/brlcad/bin/mged ? |
03:38.09 |
PhantomBantam |
I use x11 |
03:38.20 |
learner |
you should add /usr/brlcad/bin to your path,
i.e. add this line to your ~/.bash_profile: export
PATH=/usr/brlcad/bin:$PATH |
03:38.32 |
learner |
assuming you use bash |
03:39.07 |
learner |
then you'll be able to type just pix-png,
mged, etc |
03:39.33 |
learner |
that said, the command you needed was "png-pix
terrain.png | pix-bw terrain.bw" |
03:39.37 |
PhantomBantam |
Oh, Okay. |
03:39.57 |
learner |
the output was being piped to pix-bw instead
of specifying a temp file |
03:40.34 |
learner |
otherwise, that becomes two steps: png-pix
terrain.png > terrain.pix |
03:40.41 |
learner |
pix-bw terrain.pix terrain.bw |
03:54.01 |
PhantomBantam |
I tried adding that line, and it still doesn't
work |
03:54.45 |
learner |
it doesn't take effect until you either make a
new shell/xterm/whatever or resource the file manually |
03:54.52 |
learner |
source ~/.bash_profile |
04:01.39 |
PhantomBantam |
I still get the question marks. |
04:02.01 |
learner |
yes, png-pix outputs data to stdout |
04:02.10 |
learner |
so you have to redirect it to a file or a
pipe, like I showed |
04:02.20 |
learner |
23:39:33: learner: that said, the command
you needed was "png-pix terrain.png | pix-bw terrain.bw" |
04:02.37 |
learner |
23:40:34: learner: otherwise, that becomes
two steps: png-pix terrain.png > terrain.pix |
04:02.37 |
learner |
23:40:42: learner: pix-bw terrain.pix
terrain.bw |
04:03.18 |
learner |
make sense? |
04:04.20 |
PhantomBantam |
But then it says can't open
"terrain.bw" |
04:04.48 |
learner |
which did you do? |
04:04.59 |
learner |
using the pipe or the two step |
04:05.23 |
PhantomBantam |
The pipe. |
04:06.03 |
learner |
ack, my bad.. typo |
04:06.13 |
learner |
twice even |
04:06.21 |
learner |
pix-bw sends to stdout as well |
04:06.38 |
learner |
so it's: png-pix terrain.png | pix-bw >
terrain.bw |
04:06.51 |
learner |
sorry about that |
04:08.53 |
PhantomBantam |
Yes! It worked. |
04:09.48 |
learner |
you can pretty much feed any image into it
like that |
04:09.57 |
learner |
though the default values assume a 512x512
image |
04:11.32 |
learner |
actually, never mind.. any image size should
work.. pix-bw doesn't care about dimensions, neither does
cv |
04:21.52 |
PhantomBantam |
I tried, but got:mapped file open
failed |
04:21.52 |
PhantomBantam |
mapped file open failed |
04:21.52 |
PhantomBantam |
cannot find data for DSP |
04:22.15 |
learner |
what's your in line? |
04:22.33 |
learner |
you did do the cv step right? |
04:22.42 |
PhantomBantam |
yes |
04:23.35 |
learner |
hit the up arrow until you see the "in" line
that you wrote |
04:23.51 |
learner |
should look something like: in terrain dsp f
.... |
04:24.00 |
learner |
paste that here |
04:24.08 |
PhantomBantam |
in terrain.s dsp f ~/desktop/terrain.data 512
512 1 ad 1000 500 |
04:24.33 |
learner |
hmm, might be the ~ |
04:24.42 |
learner |
make it relative |
04:24.45 |
learner |
or absolute |
04:25.00 |
learner |
pwd |
04:26.45 |
PhantomBantam |
Hm? |
04:27.01 |
learner |
what does pwd say? |
04:27.24 |
PhantomBantam |
Users/PB |
04:27.45 |
learner |
<PROTECTED> |
04:27.54 |
PhantomBantam |
It works. |
04:28.07 |
PhantomBantam |
I just got rid of the ~/ |
04:28.20 |
learner |
yeah, that makes it relative |
04:28.23 |
PhantomBantam |
Wow, looks great. |
04:29.33 |
learner |
you can test out different heights by running
"kill terrain" to delete it, then up arrow to the "in" line and
change that last number (e.g. try 1000 instead of 500) |
04:29.53 |
PhantomBantam |
Okay, thanks a ton. |
04:29.58 |
learner |
small numbers will make flattened, gently
rolling terrain |
04:30.04 |
learner |
large numbers will make mountains |
04:30.30 |
learner |
changing the second to last number will change
how big/small it is |
04:32.58 |
learner |
it's one of the fastest and most efficient
terrain representations.. you can go pretty darn big and still
raytrace relatively quickly |
04:33.05 |
learner |
only limited by your machine's
memory |
04:40.29 |
PhantomBantam |
Great. |
04:43.17 |
PhantomBantam |
Ineed to go now. Thanks a ton. |
04:55.37 |
*** join/#brlcad PhantomBantam
(~phantomba@dialup-4.238.67.177.Dial1.Providence1.Level3.net) |
04:55.40 |
*** part/#brlcad PhantomBantam
(~phantomba@dialup-4.238.67.177.Dial1.Providence1.Level3.net) |
10:09.26 |
*** join/#brlcad ibot
(ibot@apt.bot.TimRiker.active.supporter.pdpc) |
10:09.26 |
*** topic/#brlcad is http://brlcad.org/ || BRL-CAD is now Open
Source! || Screenshots: http://sourceforge.net/project/screenshots.php?group_id=105292
|| http://brlcad.org/images/mged.jpg
|| Release 7.2.0 is posted (20050305) |
12:09.09 |
*** join/#brlcad CIA-3
(~CIA@flapjack.navi.cx) |
14:41.34 |
*** join/#brlcad narnia
(~terrylr@johann.blauedonau.com) |
16:02.04 |
learner |
cia is still not working.. |
16:02.15 |
learner |
slew of commits and no gratification
:) |
16:06.26 |
narnia |
no joy here either. |
16:07.43 |
learner |
did you actually start writing a
compiler? |
16:07.56 |
learner |
or something else |
16:08.03 |
learner |
or was that just a joke |
16:08.31 |
learner |
if it wasn't, gamasutra has one of the best
walkthrough's I've seen |
16:09.11 |
learner |
that's probably several months of effort to
get right, though |
16:09.53 |
narnia |
i am rewriting the parser and working through
a compiler design. several people have recommended the 'dragon
book', but that book is not a possibility. |
16:11.39 |
narnia |
there is only so much patching possible with
the old nist design. the more patches the uglier it
becomes. |
16:11.41 |
learner |
it is probably "the" book |
16:12.29 |
learner |
but certainly not necessary unless you have a
really complicated language (which express is not
comparatively) |
16:12.30 |
narnia |
yes, the 'dragon book' is 'the' book on
compiler design. |
16:13.00 |
narnia |
well, i sure would not say that. |
16:13.26 |
narnia |
the local 'where' clauses and global
rules. |
16:15.10 |
learner |
why are you going that route, though? was
there actually a showstopper? |
16:15.49 |
learner |
I would have defaulted back to the other c++
based parser next before starting fresh |
16:17.24 |
learner |
just curious |
16:18.25 |
learner |
woo hoo!.. libwdb now has support for writing
binary data objects! |
16:19.20 |
narnia |
showstoppers are: 0) not having 10303 part 4x
or 5xx series. 1) from the old nist scl source code readme file "
The |
16:19.20 |
narnia |
following subclasses of STEPaggregate are
stubs and have yet to be |
16:19.20 |
narnia |
implemented: Array, Bag, Set, List. |
16:19.20 |
narnia |
" |
16:20.41 |
narnia |
i have no idea what many entity attributes
(variables) are even used for. |
16:20.57 |
learner |
now sure what the latter means, but perhaps it
simply wasn't necessary |
16:21.29 |
learner |
isn't the 5xx series just for specific
validate tests? what's 4x? |
16:21.31 |
narnia |
then there are all rhe exceptions to the rules
that are introduced in 10303-11ed2, 10303-21-2002, etc. |
16:22.21 |
narnia |
Integrated generic resources (Parts
40-49) |
16:22.32 |
narnia |
Application interpreted constructs (Parts 500
- 599) |
16:23.02 |
learner |
okay |
16:23.11 |
learner |
why are those needed?? |
16:24.18 |
learner |
sorry for all the questions, you do know the
scl a heck of a lot better than I at this point, but for basic
geometry parser those don't seem that critical |
16:25.15 |
learner |
useful, maybe .. critical.. dunno |
16:25.17 |
narnia |
example: 10303-042e2 defines the entity
trimmed_curve. i have nothing that tells me how that trimmed_curve
behaves. |
16:26.02 |
narnia |
all geometry is defined in part 4x and
5xx. |
16:26.26 |
narnia |
ap203 just includes them. |
16:27.02 |
narnia |
i have absolutely nothing to go by that says
how the geometry entities interact. |
16:27.18 |
learner |
sure, but why do you need to know how they
behave? a trimmed curve is going to have some values that pretty
much convert 1-1 with a nurb .. it's the app's arena to make it
behave |
16:28.18 |
learner |
for a converter, behavior is limited to "is
this thing valid and representable" |
16:28.48 |
learner |
if I were modeling with step as the core data
format, that wouldn't be the case, but for a converter.. |
16:29.33 |
learner |
there's already going to be a fair amount of
simplification/omission or unsupported features even |
16:34.04 |
narnia |
i am not understanding what you are are
saying. when i asked about the conversion polyspin said that it
should either be a bag of triangles or a nm something. |
16:35.10 |
learner |
yes, that was specific to the various
tesselations you were asking about |
16:35.43 |
learner |
bots are best for triangle formats, nmg for
polygons |
16:36.24 |
learner |
splines trimmed or otherwise can either be
tesselated into a triangulated format or brought in as a nurb
directly |
16:37.41 |
learner |
that's more knowledge of brl-cad's abilities,
though.. not the step's representation's "ability" |
16:39.02 |
learner |
a sphere is a good example, given that it can
be represented in about a half-dozen ways |
16:39.26 |
narnia |
out of the numerous .stp files i have been
using i have yet to find a true polygon. |
16:40.14 |
learner |
spline spheres and actual sphere primitives in
step formate would come in as a brl-cad sphere, a tesselated one
would come in as a bot if it's triangulated, nmg
otherwise |
16:42.00 |
learner |
those mappings do get trickier, of course, but
they pretty much just have to be looked at on a 1 by 1 basis to
figure out the easiest mapping |
16:45.12 |
narnia |
example of what i am dealing with. |
16:45.17 |
narnia |
#9120 =
POLYLINE('PolyLine2',(#9113,#9118,#9117,#9116)); |
16:45.17 |
narnia |
#9130 =
POLYLINE('PolyLine2',(#9110,#9113,#9112,#9117)); |
16:45.17 |
narnia |
#9140 =
POLYLINE('PolyLine3',(#9118,#9115,#9110,#9111)); |
16:45.17 |
narnia |
#9150 =
POLYLINE('PolyLine4',(#9112,#9111,#9116,#9115)); |
16:46.26 |
narnia |
the above polyline entities define 4 lines
between the cartesian_points given as arguments. |
16:46.45 |
learner |
so 9113 is a cartesian point for
example? |
16:46.58 |
narnia |
the four polylines taken together form a
cube. |
16:47.13 |
learner |
a cube or a square? |
16:47.27 |
narnia |
9113 is an entity instance name: #9113 =
CARTESIAN_POINT('CartPt4',(0.0,0.0,2.0)); |
16:47.36 |
narnia |
a cube |
16:48.12 |
learner |
hmm.. how do four lines make a 3d
cube? |
16:48.48 |
narnia |
#9110 =
CARTESIAN_POINT('CartPt1',(0.0,0.0,0.0)); |
16:48.48 |
narnia |
#9111 =
CARTESIAN_POINT('CartPt2',(2.0,0.0,0.0)); |
16:48.48 |
narnia |
#9112 =
CARTESIAN_POINT('CartPt3',(2.0,0.0,2.0)); |
16:48.48 |
narnia |
#9113 =
CARTESIAN_POINT('CartPt4',(0.0,0.0,2.0)); |
16:48.48 |
narnia |
#9115 =
CARTESIAN_POINT('CartPt5',(0.0,2.0,0.0)); |
16:48.49 |
narnia |
#9116 =
CARTESIAN_POINT('CartPt6',(2.0,2.0,0.0)); |
16:48.51 |
narnia |
#9117 =
CARTESIAN_POINT('CartPt7',(2.0,2.0,2.0)); |
16:48.53 |
narnia |
#9118 =
CARTESIAN_POINT('CartPt8',(0.0,2.0,2.0)); |
16:48.55 |
narnia |
#9120 =
POLYLINE('PolyLine2',(#9113,#9118,#9117,#9116)); |
16:48.55 |
learner |
ahh, I think I get it.. polyline is basically
a face |
16:48.57 |
narnia |
#9130 =
POLYLINE('PolyLine2',(#9110,#9113,#9112,#9117)); |
16:48.59 |
narnia |
#9140 =
POLYLINE('PolyLine3',(#9118,#9115,#9110,#9111)); |
16:49.01 |
narnia |
#9150 =
POLYLINE('PolyLine4',(#9112,#9111,#9116,#9115)); |
16:49.08 |
learner |
multiple lines, not just one |
16:49.14 |
learner |
4 to be exact |
16:49.21 |
narnia |
well, no. that is what i thought
originally. |
16:50.28 |
narnia |
hang on i have a povray model that shows what
i am attempting to convey. |
16:50.55 |
learner |
i don't see how a single polyline can be
anything else but line segments from point to point |
16:51.11 |
learner |
the only question I'd have is whether it was a
closed loop or an open loop |
16:51.19 |
learner |
from the points, it looks open |
16:53.06 |
learner |
yeah, that makes more sense .. they're just
connected line segments, and presumably there's another entity that
ties them together |
16:56.28 |
narnia |
well no, there is no further entity that ties
them together. |
16:57.04 |
narnia |
http://204.238.34.206/cube1-polyline1.jpg |
16:57.08 |
learner |
then it's not solid geometry |
16:57.10 |
narnia |
http://204.238.34.206/cube1-polyline2.jpg |
16:57.15 |
learner |
it's just an outline of a cube |
16:57.16 |
narnia |
http://204.238.34.206/cube1-polyline2.jpg |
16:57.23 |
narnia |
http://204.238.34.206/cube1-polyline3.jpg |
16:57.31 |
narnia |
http://204.238.34.206/cube1-polyline4.jpg |
16:57.36 |
learner |
something you might find output from a sketch
editor |
16:57.54 |
narnia |
http://204.238.34.206/cube1.jpg |
16:58.16 |
learner |
yep |
16:58.23 |
learner |
i just made the same thing in mged |
16:58.59 |
narnia |
i agree, but according to way 10303 sees it it
is a cube. |
16:59.03 |
learner |
that is not a cube, though, at least from a
modeling perspective |
16:59.10 |
learner |
it is simply 4 line segments |
16:59.21 |
narnia |
i totally agree. |
16:59.34 |
learner |
i recall seeing primitive datatypes,
though |
16:59.39 |
narnia |
but to step that is a cube. |
17:00.31 |
learner |
what makes you say it's a cube, nothing from
the little bit of express you pasted would indicate that |
17:01.26 |
learner |
there's nothing that even indicates that
they're any different from any random polyline I can think
up |
17:01.35 |
narnia |
i agree. |
17:02.14 |
learner |
well, that would imply that it isn't then..
nothing to the contrary contradicts it |
17:02.56 |
learner |
dumping out 1000 points on a sphere's surface
and 100 polylines that randomly connects them all doesn't make a
sphere |
17:03.17 |
learner |
even non-random connections like this
cube |
17:04.03 |
learner |
presented with what you've shown, there's
nothing to import/convert yet |
17:04.10 |
narnia |
okay, using the above 'cube' example. how
should that be mapped to brl-cad? |
17:04.48 |
learner |
there's no solid geometry yet |
17:05.22 |
learner |
so there is no mapping yet for at least
anything we'd care about |
17:05.23 |
narnia |
you are saying there is nothing to
map? |
17:05.54 |
learner |
exactly, like I said.. there is nothing that
says those four poly lines have _anything_ to do with each other
even |
17:06.08 |
learner |
I can't just assume they do because they're in
the in file |
17:06.18 |
learner |
there could be thousands of polylines like
those |
17:07.00 |
narnia |
well, in one of the .stp files i have been
using there are 1000's of polylines like that. |
17:08.03 |
learner |
i mean add one more #9151 =
POLYLINE('PolylineFoo', (#9111, #9112, #9113, #9114)); and it's no
longer a cube |
17:08.20 |
narnia |
agree |
17:08.52 |
learner |
there has to be another entity that ties the
polylines together or there's no information about connectivity
yet |
17:10.53 |
learner |
some editors will let you make
non-solid-geometry like a segmented line that has no solid geometry
value |
17:11.23 |
learner |
so I could see a case where something might
export that to a file, but there's "nothing there" yet |
17:11.48 |
learner |
you either warn and go on, abort, or ignore
it |
17:12.01 |
learner |
i'd ignore that particular geometry until
something connects them together |
17:13.10 |
learner |
stash all the polylines in memory, but if
they're not used to make something (either a 2d sketch or a 3d
surface/object/shape) then dump them |
17:13.47 |
narnia |
even if the .stp used something like ::
GEOMETRIC_CURVE_SET('GeomCurSet1',(#9120,#9130,#9140,#9150)); |
17:13.49 |
learner |
you could technically stash them in the
brl-cad db, but not in a way useful to anything but the
converter |
17:14.31 |
learner |
now that's totally different.. that ties the
polylines together |
17:14.59 |
narnia |
which would 'join' the 4 polylines into a
labeled curve set. it still does not convey a solid. |
17:15.19 |
learner |
that there makes a geometric set, which
happens to be a closed surface |
17:16.15 |
learner |
I'd still hope there's another entity that
references that entity or it's name so that I know it's supposed to
be a cube |
17:16.26 |
narnia |
i agree it is a closed surface |
17:16.36 |
learner |
so that it can directly import as a
arb8 |
17:17.32 |
learner |
otherwise you'll have to tesellate that
surface and bring it in as an nmg (6 unoriented polygons) |
17:18.51 |
narnia |
what does arb stand for again? |
17:22.55 |
narnia |
the point i have been attempting to make is
that in many cases there is no way of knowing what the 'object' is
until the entire .stp file has been parsed and the 'object' is
'assembled' in memory. only then, in many cases, do i know what the
'object' 'looks' like. |
17:25.25 |
learner |
arb is an arbitrary regular polyhedron with as
many as 8 vertices |
17:25.57 |
learner |
basically all of the polyhedron you can make
out of the faces of a cube |
17:26.34 |
learner |
a cube, a wedge, a 4-faced pyramid, a 5-faced
pyramid, etc |
17:27.26 |
learner |
i don't doubt that you won't be able to do
anything until the entire tree is assembled in memory |
17:27.32 |
learner |
that was what I presumed libexpress actually
did |
17:27.48 |
narnia |
well no. |
17:27.53 |
learner |
then I can iterate over the geometric types,
and convert |
17:28.01 |
narnia |
libexpress parses the schema. |
17:28.30 |
learner |
which gives me something that will eat ap203
for example |
17:28.34 |
narnia |
i.e. 10303-203-aim-long.exp |
17:28.42 |
narnia |
well no. |
17:29.17 |
learner |
eh, i just said what you did and you say "well
no."? :) |
17:29.33 |
learner |
that is ap203 |
17:29.53 |
learner |
the express schema for it |
17:29.54 |
narnia |
hang on brb. |
17:35.18 |
learner |
I don't think we need to get caught up in the
exact semantics, but feel free to enlighten me. from what I
gathered at glance, libexpress parses a schema you provide like
ap203. that then effectively gives you the means to parse ap203
step files and read the data as entities. you get all the entities
into memory (either manually or assisted) and then have to decide
what/how to convert based on all of the entity types |
17:37.42 |
learner |
that doesn't "solve the entire problem", but
once all the entity types are read into memory I have enough to
convert -- i could iterate over all of the GEOMETRIC_* entity
types, for example, and convert accordingly |
17:40.02 |
learner |
of course, having to recursively dereference
subentities all the way down the heirarchy to get the actual data
like in the cube example.. I'd end up with a 6-sided polygon that
is even detectable (at least that example is, forms a nice closed
surface) and import directly as either an arb8 or an nmg |
17:43.30 |
narnia |
here is the current design: |
17:44.34 |
narnia |
parse a part21 .stp file. based on the part21
header using the appropriate ap parser parse the data sections of
the part21 .stp file |
17:45.20 |
narnia |
build a linked list of the entity instances
found in the data section. |
17:45.53 |
narnia |
based on the part21 header information
validate the data section. |
17:48.02 |
learner |
okay, so far it matches what I've
expected |
17:50.09 |
narnia |
for ap203 there are several 'presentation'
types. |
17:50.14 |
narnia |
advanced_boundary_representation |
17:50.28 |
narnia |
<PROTECTED> |
17:50.39 |
narnia |
<PROTECTED> |
17:50.49 |
narnia |
<PROTECTED> |
17:51.00 |
narnia |
<PROTECTED> |
17:51.21 |
learner |
yes, those are the specifics that polyspin
responded to.. they map rather well to the types he
mentioned |
17:51.54 |
narnia |
depending on the 'presentation' type create an
in memory model of the 'object'. |
17:53.34 |
learner |
now in the prior example, how does the
GEOMETRIC_CURVE_SET relate to presentation types? |
17:54.03 |
learner |
is it tagged as one of those or implicitly
belongs to one of those or unrelated? |
17:58.09 |
narnia |
it would either be
advanced_brep_shape_representation,
edge_based_wireframe_shape_representation,
faceted_brep_shape_representation,geometrically_bounded_surface_shape_representation,
geometrically_bounded_wireframe_shape_representation,
manifold_surface_shape_representation,
shell_based_wireframe_shape_representation, or one of the
topological_representation_item |
17:59.22 |
learner |
so implicitly belongs to any of those.. is
there a means that it would be tagged as one versus
another? |
18:01.50 |
narnia |
generally, the last entity instance in the
.stp file indicates which. example: #9200 =
GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('gbwsr',(#9160),#9190); |
18:02.21 |
narnia |
#9810=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('gbwsr',(#9800),#9828); |
18:02.32 |
learner |
ahh, beautiful |
18:02.44 |
learner |
that's the actual solid geometry |
18:02.56 |
narnia |
in the above example: 9800 is: |
18:03.11 |
narnia |
#9800 =
GEOMETRIC_CURVE_SET('GeomCurSet1',(#9110,#9111,#9130,#9131, |
18:03.11 |
narnia |
#9562,#9566,#9571,#9576,#9581,#9153,
#9586,#9158,#9159,#9591,#9173, |
18:03.11 |
narnia |
#9178,#9596,#9185,
#9601,#9606,#9194,#9195,#9198,#9611, |
18:03.11 |
narnia |
#9616,#9211,#9215,
#9621,#9227,#9626,#9631,#9238, |
18:03.11 |
narnia |
#9239,#9242,#9636,#9641,
#9258,#9263,#9646,#9272, |
18:03.12 |
narnia |
#9651,#9656,#9283,#9284,#9287,
#9661,#9666,#9303, |
18:03.14 |
narnia |
#9308,#9671,#9317,#9676,
#9681,#9328,#9329,#9332,#9686,#9691, |
18:03.16 |
narnia |
#9348,#9353,#9696,
#9362,#9701,#9706,#9373,#9374, |
18:03.18 |
narnia |
#9377,#9711,#9716,#9393,
#9398,#9721,#9407,#9726, |
18:03.20 |
narnia |
#9413,#9414,#9450,#9451,#9460,#9461,#9470,#9471,#9480,#9481,#9490,#9491, |
18:03.22 |
narnia |
#9500,#9501,#9510,#9511,#9520,#9521,#9530,#9531,#9540,#9541,#9550,#9551)); |
18:03.24 |
narnia |
you get the point. |
18:03.49 |
learner |
actually, i'd say 9800 is not the geometry..
it's just the shape/collection |
18:03.50 |
narnia |
i have to 'drill' down to figure out what the
object looks like. |
18:04.10 |
learner |
in the absence of 9810, I was presuming the
contents |
18:04.18 |
learner |
same with the cube example |
18:04.35 |
narnia |
yes |
18:04.56 |
learner |
but having it tell me that it's one
representation versus another makes it a geometric shape as opposed
to a collection of values |
18:05.40 |
learner |
those represenation entities are what the
converter would iterate over then |
18:05.57 |
learner |
recursively looking up their contents for
conversion values |
18:06.24 |
learner |
build up an in-memory representation of the
geometry |
18:10.00 |
narnia |
http://204.238.34.206/star1-p21.txt
is a good example. i have been using this one for
testing. |
18:18.27 |
narnia |
hang on i am trying to get a screenshot of the
star1.p21 object. |
18:21.58 |
narnia |
opencascade shows http://204.238.34.206/star1-p21.jpg |
18:23.53 |
narnia |
how would you suggest that be mapped to
brl-cad? |
18:29.20 |
learner |
looks like it'd convert in as a nurbs surface
given all the trimmed curve entities |
18:30.00 |
learner |
alternatively, you could tesselate the curves
and import in as a bot/nmg |
18:30.24 |
learner |
the latter wouldn't be ideal, but it would
work easiest |
18:31.10 |
learner |
if you could detect that it's basicly one 2d
shape, it best converts in as a sketch and an extrusion fully
preserving |
18:31.55 |
learner |
it doesn't look like it is represented that
way in the step file, though.. so probably nurbs |
18:33.21 |
learner |
the wireframe with curve models are going to
be the hardest to decide on how to convert them -- probably just as
easy to add a new wireframe primitive to brl-cad that fully
captures it |
18:35.19 |
learner |
wireframe modeling provides no benefit over
what we already have, it's just a different (less efficient)
representation |
18:35.35 |
learner |
it could be added pretty easily,
though |
18:36.04 |
learner |
it's basically an extension of the sketch
primitive into 3D, just a heck of a lot harder to guarantee
closure |
18:36.27 |
narnia |
i find that most of the .stp files i have seen
could have been modeled in a more efficient manner. the star1 is a
good example. |
18:37.05 |
narnia |
ap203 does have both a surface of revolution
and surface of linear sweep. |
18:37.44 |
narnia |
the star1 should have been exported as a
surface of linear sweep and be done with it. |
18:39.09 |
learner |
there is motivation to add both a wireframe
primitive and/or a spline-based curvature boundary
representation |
18:39.19 |
learner |
but that's somewhere down the line |
18:39.55 |
narnia |
do you have a better understanding of where i
am coming from. |
18:40.12 |
narnia |
and what i am dealing with? |
18:42.44 |
learner |
csg would have you model that star as a
cylinder with 20 objects (7 cylinders, 13 boxes)
subtracted |
18:44.48 |
learner |
getting back to the original question, though,
I haven't seen anything that warrants requiring a compiler .. you
can get at the entities, those are pretty much all that's
needed |
18:45.54 |
learner |
easy answer is to just tesselate that surface
and bring it in as a bot -- that's pretty much what the iges
converter does |
18:46.12 |
learner |
it's not 100% faithful, but then conversions
almost never are |
18:46.28 |
learner |
for faithful, I'd take the two weeks to add
that new primitive |
18:48.49 |
narnia |
the compiler is still needed at some point in
the future. there is far too much glue that has to be written by
hand at the moment. |
18:50.58 |
learner |
what is it doing for you though? |
18:52.09 |
learner |
you feed it a step file, it crunches it
through to some optimal in-memory representation? |
18:53.40 |
learner |
there is not going to be a faithful
representation no matter how you cut it without adding the union of
all step-recognized geometry representations to brl-cad |
18:54.45 |
learner |
so you have to write the translation code..
that could go in a "compiler", i'd probably just call that a
library -- or it can simply be the guts to the converter |
18:55.29 |
learner |
there's not much room for reuse without
limiting the step to some subset in memory |
19:05.30 |
narnia |
i will think on it later. i need to go to
farm&fleet and get some parts and gasoline for the lawn mower.
my daughter is awake now so she can drive me. over cast day but
still warm enough to get somethings done. also need to look at the
water softner's timer and see why it stopped working. never an end
to upkeep. |
19:06.06 |
learner |
alrighty, have a good one |
19:06.12 |
narnia |
always something demanding attention
(repair). |
19:27.44 |
*** join/#brlcad CIA-3
(~CIA@flapjack.navi.cx) |
21:25.04 |
*** join/#brlcad CIA-3
(~CIA@flapjack.navi.cx) |