i am attempting to write a dxf file and i am ending up with an extrustion by default. i am wantiing a plain 2D look and ending up with an isometric look. is there combination (230,240,250) to get this done? or is there a group code in the header that i am overlooking?
0
SECTION
2
HEADER
999
ellipse.dxf.
999
ellipse.dxf.
0
ENDSEC
0
SECTION
2
TABLES
0
ENDSEC
0
SECTION
2
BLOCKS
0
ENDSEC
0
$ANGBASE
0
SECTION
2
ENTITIES
0
ELLIPSE
5
262
330
1F
100
AcDbEntity
8
0
100
AcDbEllipse
62
1
10
990
20
-651
30
0
11
415
21
-153
31
0
210
0
220
0
230
1
40
0.36987951807228914
13
990
23
651
33
0
41
0
42
6.283185307179586
50
0
0
ENDSEC
0
EOF
this looks like an "isometric/ extrusion angle" being applied to the render,..i have attempted many combinations (210,220,230) and it stays the exact same,.. now where i am saying i am trying to remove the rotation,.. actually i would like to be able to control the rotation,,.. but i do not see where "group code 50" or a comparable group code listed as an option for the ellipse in the dxf manual that is online. i have been wrestling with this for days. i hope i am in the right place and that you kindly forum reader can help me out. thanks in advance.
i have made changes to the dxf per your instruction and i am still getting a rotation and the points (10,20,30) are for sure perpendicular to the points (11,21,31),.. any ideas or comments? look forward to hearing what you think. thanks
0
SECTION
2
HEADER
999
drawing.dxf.
999
drawing.dxf
0
ENDSEC
0
SECTION
2
TABLES
0
ENDSEC
0
SECTION
2
BLOCKS
0
ENDSEC
0
$ANGBASE
0
SECTION
2
ENTITIES
0
ELLIPSE
5
262
330
1F
100
AcDbEntity
8
0
100
AcDbEllipse
62
1
10
968
20
-630
30
0
11
1537
21
-630
31
0
210
0
220
0
230
1
40
0.3251318101933216
41
0
42
6.283185307179586
0
ENDSEC
0
EOF
1. Set your code 21 to zero and check the ellipse again, is this what you stumpled?
2. Your "DXF File" doesn't match the DXF Definition for R13 (lowest format for Ellipse objects)
If your viewer read this file, good for you, but "wrong"*. Means: Possible that the next program can't read the file.
*The ellipse entitiy is okay, but all around is not enough, a minimum DXF for R13 or should have more content if i am right.
Sebastian
so you are saying to correct it with trial and error adding a factor to it? if i know a hard angle that is being applied i can deal with that, i can solve for it.. but i don't want to have to guess. can we agree its maybe a 45^ angle that is being applied??,... now i must say that the angle that is happening with the ellipse is not occuring with lines,.. a line described as 0 along the horizontal and vertical axis show up as such and so it is does not appear to be "drawing setting" / "WCS" issue. so let me run with things a little more and i will let the group know how it went. ok? ok. & again i thank everyone for their contribution to this thus far.
i mean that i have equations for the ellipses rotations matrix and so if i knew the exact angle this is coming in at and if that is an industry standard, then i can cascade in the angle and calc where the side of the ellipse should be, rather than to guess at what angle looks closest. also i am looking at what the dxf manual is saying about (11,21,31) says "relative to the center in WCS",.. is this is saying the number should be a distance from (10,20,30) and not a coordinate?
i am forgetting to show you behind the scenes the generation of the file,.. seems one mans ellipse is the next guys oval and i am attempting to save to this file format to make a thing i working on more useful.
if al>0 then
for i = 1 to al
LIST.GET ovalpts,i*5,oval2z
GR.GET.VALUE gooval1[i],"left",left2,"top",top2,"right",right2,"bottom",bottom2
GR.GET.VALUE rotovalang[i],"x",rotx,"y",roty,"angle",angle
width=(right2-left2)
height=(bottom2-top2)
!ptx1 is x center of rectangle
!pty1 is y center of rectangle
ptx1=left2+(width/2)
pty1=top2+(height/2)
!rotx is x point of rotation
!roty is y point of rotation
dzx2=rotx-ptx1
dzy2=roty-pty1
!dzx2 is x difference point of rotation, center of rectangle
!dzy2 is y difference point of rotation, center of rectangle
dzx3=ptx1+dzx2
dzy3=pty1+dzy2
ltx = (left2-dzx3)*cos(TORADIANS(angle)) - (top2-dzy3)*sin(TORADIANS(angle))+dzx3
lty = (left2-dzx3)*sin(TORADIANS(angle)) + (top2-dzy3)*cos(TORADIANS(angle))+dzy3
rtx = (right2-dzx3)*cos(TORADIANS(angle)) - (top2-dzy3)*sin(TORADIANS(angle))+dzx3
rty = (right2-dzx3)*sin(TORADIANS(angle)) + (top2-dzy3)*cos(TORADIANS(angle))+dzy3
lbx = (left2-dzx3)*cos(TORADIANS(angle)) - (bottom2-dzy3)*sin(TORADIANS(angle))+dzx3
lby = (left2-dzx3)*sin(TORADIANS(angle)) + (bottom2-dzy3)*cos(TORADIANS(angle))+dzy3
rbx = (right2-dzx3)*cos(TORADIANS(angle)) - (bottom2-dzy3)*sin(TORADIANS(angle))+dzx3
rby = (right2-dzx3)*sin(TORADIANS(angle)) + (bottom2-dzy3)*cos(TORADIANS(angle))+dzy3
ov_mrx_a=((rbx+rtx)/2)
ov_mry_a=((rby+rty)/2)
ov_mbx_a=((rbx+lbx)/2)
ov_mby_a=((rby+lby)/2)
GR.GET.VALUE gooval1[i],"left",left2,"top",top2,"right",right2,"bottom",bottom2
GR.GET.VALUE rotovalang[i],"x",rotx,"y",roty,"angle",angle
angle=angle-25
width=(right2-left2)
height=(bottom2-top2)
!ptx1 is x center of rectangle
!pty1 is y center of rectangle
ptx1=left2+(width/2)
pty1=top2+(height/2)
!rotx is x point of rotation
!roty is y point of rotation
dzx2=rotx-ptx1
dzy2=roty-pty1
!dzx2 is x difference point of rotation, center of rectangle
!dzy2 is y difference point of rotation, center of rectangle
dzx3=ptx1+dzx2
dzy3=pty1+dzy2
ltx = (left2-dzx3)*cos(TORADIANS(angle)) - (top2-dzy3)*sin(TORADIANS(angle))+dzx3
lty = (left2-dzx3)*sin(TORADIANS(angle)) + (top2-dzy3)*cos(TORADIANS(angle))+dzy3
rtx = (right2-dzx3)*cos(TORADIANS(angle)) - (top2-dzy3)*sin(TORADIANS(angle))+dzx3
rty = (right2-dzx3)*sin(TORADIANS(angle)) + (top2-dzy3)*cos(TORADIANS(angle))+dzy3
lbx = (left2-dzx3)*cos(TORADIANS(angle)) - (bottom2-dzy3)*sin(TORADIANS(angle))+dzx3
lby = (left2-dzx3)*sin(TORADIANS(angle)) + (bottom2-dzy3)*cos(TORADIANS(angle))+dzy3
rbx = (right2-dzx3)*cos(TORADIANS(angle)) - (bottom2-dzy3)*sin(TORADIANS(angle))+dzx3
rby = (right2-dzx3)*sin(TORADIANS(angle)) + (bottom2-dzy3)*cos(TORADIANS(angle))+dzy3
LIST.GET oval_color,i*4-3,r
LIST.GET oval_color,i*4-2,g
LIST.GET oval_color,i*4-1,b
LIST.GET oval_color,i*4,f
TEXT.WRITELN fnum,"0"
TEXT.WRITELN fnum,"ELLIPSE"
TEXT.WRITELN fnum,"5"
TEXT.WRITELN fnum,"262"
TEXT.WRITELN fnum,"330"
TEXT.WRITELN fnum,"1F"
TEXT.WRITELN fnum,"100"
TEXT.WRITELN fnum,"AcDbEntity"
TEXT.WRITELN fnum,"8"
TEXT.WRITELN fnum,"0"
TEXT.WRITELN fnum,"100"
TEXT.WRITELN fnum,"AcDbEllipse"
TEXT.WRITELN fnum,"62"
if r=255 & g=0 & b=0 then
p=1
elseif r=255 & g=255 & b=0 then
p=2
elseif r=0 & g=255 & b=0 then
p=3
elseif r=0 & g=0 & b=255 then
p=5
elseif r=255 & g=0 & b=255 then
p=6
elseif r=255 & g=255 & b=255 then
p=7
elseif r=150 & g=150 & b=150 then
p=8
elseif r=0 & g=0 & b=0 then
p=0
endif
TEXT.WRITELN fnum,INT$(p)
TEXT.WRITELN fnum,"10"
TEXT.WRITELN fnum,INT$(ptx1)
TEXT.WRITELN fnum,"20"
TEXT.WRITELN fnum,INT$(-pty1)
TEXT.WRITELN fnum,"30"
TEXT.WRITELN fnum,INT$(oval2z)
ov_mrx=((rbx+rtx)/2)
ov_mry=((rby+rty)/2)
ov_mbx=((rbx+lbx)/2)
ov_mby=((rby+lby)/2)
fac1x=(ov_mrx_a-ptx1)/(ov_mrx_a)
fac1y=(ov_mry_a-pty1)/(ov_mry_a)
fac2x=ov_mrx_a/ov_mrx
fac2y=ov_mry_a/ov_mry
ov_mrx=ov_mrx*fac1x*fac2x
ov_mry=ov_mry*fac1y*fac2y
if (bottom2-pty1)<(right2-ptx1) then
TEXT.WRITELN fnum,"11"
TEXT.WRITELN fnum,INT$(ov_mrx)
TEXT.WRITELN fnum,"21"
TEXT.WRITELN fnum,INT$(-ov_mry)
endif
if (bottom2-pty1)>(right2-ptx1) then
TEXT.WRITELN fnum,"11"
TEXT.WRITELN fnum,INT$(ov_mbx)
TEXT.WRITELN fnum,"21"
TEXT.WRITELN fnum,INT$(-ov_mby)
endif
TEXT.WRITELN fnum,"31"
TEXT.WRITELN fnum,INT$(oval2z)
TEXT.WRITELN fnum,"210"
TEXT.WRITELN fnum,"0"
TEXT.WRITELN fnum,"220"
TEXT.WRITELN fnum,"0"
TEXT.WRITELN fnum,"230"
TEXT.WRITELN fnum,"1"
TEXT.WRITELN fnum,"40"
if (bottom2-pty1)<(right2-ptx1) then
ratio1=(bottom2-pty1)/(right2-ptx1)
TEXT.WRITELN fnum,FRAC(ratio1)
else
ratio1=(right2-ptx1)/(bottom2-pty1)
TEXT.WRITELN fnum,FRAC(ratio1)
endif
TEXT.WRITELN fnum,"41"
TEXT.WRITELN fnum,"0"
TEXT.WRITELN fnum,"42"
TEXT.WRITELN fnum,"6.283185307179586"
next i
endif
Can't find what you're looking for? Ask the community or share your knowledge.