DXF图像实体组代码说明 [英] DXF image entity group code explanation

查看:203
本文介绍了DXF图像实体组代码说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Delphi类来从DXF文件导入/导出某种实体。
我想添加对Image实体的支持,但我不理解某些组代码。

I'm working on a Delphi class to import/export some kind of entities from DXF file. I'd like add support for Image entity but I don't understand some group codes.

我正在使用官方DXF指南参考(2002): http://www.autodesk.com/techpubs/autocad/dxf/dxf2002.pdf

I'm using official DXF guide reference (2002): http://www.autodesk.com/techpubs/autocad/dxf/dxf2002.pdf

我理解群组代码10,20和30,有插入点并且像其他任何实体一样工作。

I have understand the group codes 10, 20 and 30, there are the "Insertion point" and work like any other entities.

问题是组码:
-11,21和31:单个像素的U向量(沿图像的可视底部指向,
起始于插入点)(在WCS中);

The problem are group codes: -11, 21 and 31: U-vector of a single pixel (points along the visual bottom of the image, starting at the insertion point) (in WCS);

-12,22和32:单个像素的V矢量(沿图像左侧的点,
从插入点开始)(在WCS中);

-12, 22 and 32: V-vector of a single pixel (points along the visual left side of the image, starting at the insertion point) (in WCS);

我认为DXF使用它进行缩放和旋转但我不知道如何。

I think DXF use it for scale and rotation but I don't have understand how.

谢谢

推荐答案

这些组代码用于控制r图像的比例和比例。

These group codes are used for controlling the rotation and scale of the image.

组码 10 20 30 控制图片左下角的插入点。

Group codes 10, 20 and 30 control the insertion point of the lower left corner of your image.

组代码 11 21 31 用于定义向量无论图像的原点如何,3D空间都是行的终点,其起点假设为 0,0,0 。这些组代码描述了一个相对向量。

The group codes 11, 21 and 31 are used to define a vector in 3D space that is the endpoint of a line whose start point is assumed to be 0,0,0, regardless of the origin point of the image. These group codes describe a relative vector.

这个相对向量(对于比例因子为1)由一个半径为1/8的平方根的圆约束,或0.352733677 ...

This relative vector (for a scale factor of 1) is constrained by a circle whose radius is the square root of 1/8, or 0.352733677...

例如,插入时没有旋转且比例因子为1的图像将具有 11 21 31 组代码值 0.352733677,0,0 分别。

For example, an image inserted with no rotation, and a scale factor of 1, would have 11, 21, 31 group code values of 0.352733677,0,0 respectively.

插入一个没有旋转的图像,比例因子为2, 11 21 31 组代码值 0.7054673542,0,0

An image inserted with no rotation, and a scale factor of 2, would have 11, 21, 31 group code values of 0.7054673542,0,0 respectively.

插入45度旋转且比例因子为1的图像将具有 11 21 31 组代码 0.25,0.25,0 。这是一个奇数偶数,但这就是数学运算的方式。

An image inserted with a 45 degree rotation and a scale factor of 1, would have 11, 21, 31 group codes of 0.25,0.25,0 respectively. Which is an oddly even number, but that's the way the math works out.

比例因子是半径为sqrt(1/8)的圆的乘数。根据比例因子获得此半径后,您可以使用 sin cos 旋转角度。

The scale factor is a multiplier of the circle whose radius is sqrt(1/8). Once you have this radius based on the scale factor, you can determine the '11' and '21' values using sin and cos of the rotation angle.

12 22 32 组代码具有相似的值,但是对于图像的左边缘。

将使用相同的数学来确定它们的值。这似乎过度约束了图像,但这就是规范的工作方式。

The 12, 22, 32 group codes have similar values, but for the left edge of the image.
The same math would be used to determine their values. It seems like over-constraining the image, but that's the way the specification works.

编辑

以上答案仅对保存于的光栅图像有效72 dpi然后插入公制(毫米级)绘图。

The above answer is only valid for a raster image saved at 72 dpi and then inserted into a metric (millimeter scale) drawing.

确定适当值的公式(插入图像时的比例因子为1)例如,11组代码中的AuoCAD绘图是:

The formula for figuring out what the proper value (for a scale factor of 1 when inserting the image in the AuoCAD drawing) in the '11' group code, for example, is:

(drawing units per inch) / (dpi of image)

在使用毫米作为绘图单位并保存光栅图像的公制dxf图形中在72 dpi时,比例因子将是 25.4 / 72 = .35277778

In a metric dxf drawing that uses millimeters as the drawing units, and a raster image saved at 72 dpi, the scale factor would be 25.4/72 = .35277778

在使用的公制dxf图纸中作为绘图单位的毫米,以及96 dpi保存的光栅图像,比例因子将是 25.4 / 96 = .26458333

In a metric dxf drawing that uses millimeters as the drawing units, and a raster image saved at 96 dpi, the scale factor would be 25.4/96 = .26458333

在使用英寸作为绘图单位的英制dxf绘图中,以及以72 dpi保存的光栅图像时,比例因子将为 1/72 = .013888888

In an imperial dxf drawing that uses inches as the drawing units, and a raster image saved at 72 dpi, the scale factor would be 1/72 = .013888888.

在使用英寸作为绘图单位的英制dxf绘图中,以及以96 dpi保存的光栅图像时,比例因子将为 1/96 = .010416667

In an imperial dxf drawing that uses inches as the drawing units, and a raster image saved at 96 dpi, the scale factor would be 1/96 = .010416667.

当在像AutoCAD这样的程序中打开dxf文件时,光栅图像是按照上面显示的比例因子绘制的,所以我们的第一个例子的大小为图像宽度(以像素为单位)*比例因子在11 中,对于100x100px图像,将为35.2778 mm。

When the dxf file is then opened in a program like AutoCAD, the raster image is drawn at the scale factor shown above, so our first example would be drawn at a size of width of image in pixels * scale factor in 11, which for a 100x100px image, would be 35.2778 mm.

这篇关于DXF图像实体组代码说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆