Initial commit
Made-with: Cursor
This commit is contained in:
BIN
astral-service/static/lib/libredwg/dwg2SVG.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwg2SVG.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwg2dxf.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwg2dxf.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwgbmp.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwgbmp.exe
Normal file
Binary file not shown.
80
astral-service/static/lib/libredwg/dwgfilter
Normal file
80
astral-service/static/lib/libredwg/dwgfilter
Normal file
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
# options: --help, --version, --debug, -i
|
||||
version() {
|
||||
echo "dwgfilter 20c18f6f"
|
||||
exit
|
||||
}
|
||||
help() {
|
||||
echo "dwgfilter [OPTIONS...] dwgfile"
|
||||
echo ""
|
||||
echo "Allow custom jq queries on a temporary JSON dump."
|
||||
echo ""
|
||||
echo "OPTIONS: --help,--version"
|
||||
echo " --debug keep the tmp json"
|
||||
echo " -i write back in-place, with an updating JQ query"
|
||||
echo " ... all other options are passed to jq. See 'man jq'"
|
||||
exit
|
||||
}
|
||||
|
||||
opts=
|
||||
# get last arg
|
||||
for dwg; do true; done
|
||||
for arg in "$@"
|
||||
do
|
||||
case $arg in
|
||||
--help) help ;;
|
||||
--version) version ;;
|
||||
--debug) debug=1 ;;
|
||||
"$dwg") if [ ! -f "$dwg" ]; then echo DWG "$dwg" not found; exit 1; fi ;;
|
||||
-i) writemode=1 ;;
|
||||
*) opts="$opts $arg" ;;
|
||||
esac
|
||||
done
|
||||
if [ ! -f "$dwg" ]
|
||||
then
|
||||
echo Wrong input DWG "$dwg"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$opts" ]
|
||||
then
|
||||
echo Input JQ query arguments missing
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prefix=""
|
||||
exec_prefix="${prefix}"
|
||||
jq=""
|
||||
jq="${jq:-jq}"
|
||||
json="/tmp/dwgfilter-$$.json"
|
||||
selfpath="$(realpath "$0")"
|
||||
if [ "$selfpath" = "${exec_prefix}/bin/dwgfilter" ]; then
|
||||
dwgread="${exec_prefix}/bin/dwgread"
|
||||
dwgwrite="${exec_prefix}/bin/dwgwrite"
|
||||
else
|
||||
dwgread="$(dirname "$selfpath")/dwgread"
|
||||
dwgwrite="$(dirname "$selfpath")/dwgwrite"
|
||||
fi
|
||||
|
||||
if [ -n "$debug" ]; then
|
||||
dwgread="$dwgread -v3"
|
||||
dwgwrite="$dwgwrite -v3"
|
||||
fi
|
||||
echo "$dwgread -O json -o $json $dwg"
|
||||
$dwgread -O json -o "$json" "$dwg"
|
||||
echo "$jq $opts $json"
|
||||
$jq "$opts" "$json"
|
||||
fail=$?
|
||||
if [ $fail = 0 ] && [ -n "$writemode" ]; then
|
||||
mv "$dwg" "$dwg.bak"
|
||||
echo "$dwgwrite -o $dwg $json"
|
||||
if $dwgwrite -o "$dwg" "$json"; then
|
||||
:
|
||||
else
|
||||
mv "$dwg.bak" "$dwg"
|
||||
fail=1
|
||||
fi
|
||||
fi
|
||||
if [ -z "$debug" ]; then
|
||||
rm "$json"
|
||||
fi
|
||||
exit $fail
|
||||
BIN
astral-service/static/lib/libredwg/dwggrep.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwggrep.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwglayers.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwglayers.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwgread.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwgread.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwgrewrite.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwgrewrite.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dwgwrite.exe
Normal file
BIN
astral-service/static/lib/libredwg/dwgwrite.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dxf2dwg.exe
Normal file
BIN
astral-service/static/lib/libredwg/dxf2dwg.exe
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/dxfwrite.exe
Normal file
BIN
astral-service/static/lib/libredwg/dxfwrite.exe
Normal file
Binary file not shown.
152
astral-service/static/lib/libredwg/examples/bd.c
Normal file
152
astral-service/static/lib/libredwg/examples/bd.c
Normal file
@@ -0,0 +1,152 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2018-2019 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* bd.c: print double of bits
|
||||
* written by Reini Urban
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../src/config.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dwg.h"
|
||||
#include "../src/bits.h"
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char *input;
|
||||
int hex = 0;
|
||||
int size, bits;
|
||||
unsigned long pos;
|
||||
Bit_Chain dat = EMPTY_CHAIN (0);
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
printf ("usage: examples/bd "
|
||||
"001100000000000000000000000000011000000000000000100000001010010"
|
||||
"00\n");
|
||||
printf ("or examples/bd -x '8055 40f9 3284 d222 3e40 7436 e0d9 23fd'\n");
|
||||
return 1;
|
||||
}
|
||||
if (argc > 2 && !strcmp (argv[1], "-x"))
|
||||
{
|
||||
hex = 1;
|
||||
input = argv[2];
|
||||
size = strlen (input);
|
||||
}
|
||||
else
|
||||
{
|
||||
input = argv[1];
|
||||
bits = strlen (input);
|
||||
size = (bits / 8);
|
||||
}
|
||||
|
||||
dat.chain = malloc (size + 1);
|
||||
dat.size = size;
|
||||
dat.version = R_2004;
|
||||
if (hex)
|
||||
{
|
||||
dat.size = bit_write_hexbits (&dat, input);
|
||||
bits = dat.size / 8;
|
||||
}
|
||||
else
|
||||
bit_write_bits (&dat, input);
|
||||
pos = bit_position (&dat);
|
||||
bit_set_position (&dat, 0);
|
||||
// accept more types, like CMC, BS, BL, HANDLE and print all possible
|
||||
// variants
|
||||
if (pos == 64)
|
||||
{
|
||||
double d = bit_read_RD (&dat);
|
||||
printf ("%.15f RD @%lu\n", d, bit_position (&dat));
|
||||
}
|
||||
else if (pos == 2 || pos > 64)
|
||||
{
|
||||
double d = bit_read_BD (&dat);
|
||||
printf ("%.15f BD @%lu (%ld)\n", d, bit_position (&dat), pos);
|
||||
if (pos == 2)
|
||||
{
|
||||
int i;
|
||||
bit_set_position (&dat, 0);
|
||||
i = bit_read_BB (&dat);
|
||||
printf ("%d BB @%lu\n", i, bit_position (&dat));
|
||||
if (i == 2)
|
||||
printf ("%d BS/BL @%lu\n", 0, bit_position (&dat));
|
||||
else if (i == 3)
|
||||
printf ("%d BS @%lu\n", 256, bit_position (&dat));
|
||||
}
|
||||
}
|
||||
else if (pos == 34)
|
||||
{
|
||||
long l = bit_read_BL (&dat);
|
||||
printf ("%ld BL @%lu\n", l, bit_position (&dat));
|
||||
}
|
||||
else if (pos == 32)
|
||||
{
|
||||
long l = bit_read_RL (&dat);
|
||||
printf ("%ld RL @%lu\n", l, bit_position (&dat));
|
||||
}
|
||||
else if (pos == 16)
|
||||
{
|
||||
int l = (int)bit_read_RS (&dat);
|
||||
printf ("%d RS @%lu\n", l, bit_position (&dat));
|
||||
}
|
||||
else if (pos == 10)
|
||||
{
|
||||
long l = bit_read_BS (&dat);
|
||||
Dwg_Handle h;
|
||||
printf ("%ld BS @%lu\n", l, bit_position (&dat));
|
||||
bit_set_position (&dat, 0);
|
||||
if (!bit_read_H (&dat, &h) && h.size == 1)
|
||||
printf (FORMAT_H " H @%lu (%ld)\n", ARGS_H (h), bit_position (&dat),
|
||||
pos);
|
||||
}
|
||||
else if (pos == 8)
|
||||
{
|
||||
int l = (int)bit_read_RC (&dat);
|
||||
Dwg_Handle h;
|
||||
printf ("%d RC @%lu\n", l, bit_position (&dat));
|
||||
bit_set_position (&dat, 0);
|
||||
if (!bit_read_H (&dat, &h) && h.size == 1)
|
||||
printf (FORMAT_H " H @%lu (%ld)\n", ARGS_H (h), bit_position (&dat),
|
||||
pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dwg_Handle h;
|
||||
Dwg_Color c;
|
||||
double d = bit_read_BD (&dat);
|
||||
if (pos >= bit_position (&dat))
|
||||
{
|
||||
printf ("%.15f BD? @%lu (%ld)\n", d, bit_position (&dat), pos);
|
||||
}
|
||||
else
|
||||
{ // divide into chunks of 34,32,18,16,10,8,2
|
||||
printf ("? (%ld)\n", pos);
|
||||
}
|
||||
bit_set_position (&dat, 0);
|
||||
if (!bit_read_H (&dat, &h))
|
||||
printf (FORMAT_H " H? @%lu (%ld)\n", ARGS_H (h), bit_position (&dat),
|
||||
pos);
|
||||
bit_set_position (&dat, 0);
|
||||
bit_read_CMC (&dat, &dat, &c);
|
||||
if (c.index < 257)
|
||||
printf ("%d 0x%06X 0x%x CMC? @%lu (%ld)\n", c.index, c.rgb, c.flag,
|
||||
bit_position (&dat), pos);
|
||||
}
|
||||
free (dat.chain);
|
||||
return 0;
|
||||
}
|
||||
232
astral-service/static/lib/libredwg/examples/bits.c
Normal file
232
astral-service/static/lib/libredwg/examples/bits.c
Normal file
@@ -0,0 +1,232 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2018-2019 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* bits.c: print all possible type/values of given bits
|
||||
* written by Reini Urban
|
||||
*/
|
||||
|
||||
#include "../src/config.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "dwg.h"
|
||||
#include "../src/bits.h"
|
||||
static int maxoff = 0;
|
||||
|
||||
static int
|
||||
decode (Bit_Chain *dat, int off, const int size)
|
||||
{
|
||||
int pos = 0;
|
||||
BITCODE_BS bs = 0;
|
||||
printf ("decode offset:%d, size:%d\n", off, size);
|
||||
if (off >= size)
|
||||
return 0;
|
||||
|
||||
bit_set_position (dat, off);
|
||||
if (size - off >= 66)
|
||||
{
|
||||
double d = bit_read_BD (dat);
|
||||
int p = (int)bit_position (dat);
|
||||
if (d != bit_nan ())
|
||||
{
|
||||
printf ("%.15f BD @%d (%d)\n", d, p, size);
|
||||
pos = p;
|
||||
}
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 64)
|
||||
{
|
||||
double d = bit_read_RD (dat);
|
||||
int p = (int)bit_position (dat);
|
||||
if (d != bit_nan ())
|
||||
{
|
||||
printf ("%.15f RD @%d (%d)\n", d, p, size);
|
||||
pos = p;
|
||||
}
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 34)
|
||||
{
|
||||
BITCODE_BL l = (long)bit_read_BL (dat);
|
||||
int p = (int)bit_position (dat);
|
||||
if (p <= size - off)
|
||||
{
|
||||
printf ("%u BL @%d (%d)\n", l, p, size);
|
||||
pos = p;
|
||||
}
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 32)
|
||||
{
|
||||
BITCODE_BL l = (long)bit_read_RL (dat);
|
||||
pos = (int)bit_position (dat);
|
||||
printf ("%u RL @%d (%d)\n", l, pos, size);
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 16)
|
||||
{
|
||||
BITCODE_RS l = (int)bit_read_RS (dat);
|
||||
pos = (int)bit_position (dat);
|
||||
printf ("%d RS @%d (%d)\n", l, pos, size);
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 10)
|
||||
{
|
||||
int p;
|
||||
bs = bit_read_BS (dat);
|
||||
p = (int)bit_position (dat);
|
||||
if (p <= size - off)
|
||||
{
|
||||
printf ("%d BS @%d (%d)\n", bs, p, size);
|
||||
pos = p;
|
||||
}
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 8)
|
||||
{
|
||||
int l = bit_read_RC (dat);
|
||||
pos = (int)bit_position (dat);
|
||||
printf ("%d RC @%d (%d)\n", l, pos, size);
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 8)
|
||||
{
|
||||
Dwg_Handle h;
|
||||
int err, p;
|
||||
err = bit_read_H (dat, &h);
|
||||
p = (int)bit_position (dat);
|
||||
if (!err && h.size == 1 && p <= size - off)
|
||||
{
|
||||
printf ("%x.%d.%lX H @%d (%d)\n", h.code, h.size, h.value, p, size);
|
||||
pos = p;
|
||||
}
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 4)
|
||||
{
|
||||
Dwg_Color c;
|
||||
int p;
|
||||
bit_read_CMC (dat, dat, &c);
|
||||
p = (int)bit_position (dat);
|
||||
if (c.index < 257 && p <= size - off)
|
||||
{
|
||||
printf ("%d 0x%06X 0x%x CMC @%d (%d)\n", c.index, c.rgb, c.flag, p,
|
||||
size);
|
||||
pos = p;
|
||||
}
|
||||
free (c.name);
|
||||
free (c.book_name);
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
if (size - off >= 2)
|
||||
{
|
||||
int i = bit_read_BB (dat);
|
||||
pos = (int)bit_position (dat);
|
||||
printf ("%d BB @%d (%d)\n", i, pos, size);
|
||||
if (i == 2)
|
||||
printf ("%d BS/BL @%d (%d)\n", 0, pos, size);
|
||||
else if (i == 3)
|
||||
printf ("%d BS @%d (%d)\n", 256, pos, size);
|
||||
bit_set_position (dat, off);
|
||||
}
|
||||
// if BS is a valid length try TV also
|
||||
if (bs > 0 && bs < size - off - pos)
|
||||
{
|
||||
int i;
|
||||
char *s = bit_read_TV (dat);
|
||||
int p = (int)bit_position (dat);
|
||||
if (s)
|
||||
{
|
||||
for (i = 0; i < bs; i++)
|
||||
if (!isprint (s[i]))
|
||||
break;
|
||||
if (i == bs)
|
||||
{
|
||||
printf ("%s TV @%d (%d)\n", s, pos, size);
|
||||
pos = p;
|
||||
}
|
||||
free (s);
|
||||
}
|
||||
}
|
||||
|
||||
while (pos < size)
|
||||
{
|
||||
if (pos <= off)
|
||||
pos++;
|
||||
if (maxoff < pos)
|
||||
maxoff = pos;
|
||||
// printf ("offset %d\n", pos);
|
||||
return decode (dat, off + 1, size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int hex = 0;
|
||||
int i;
|
||||
int pos;
|
||||
Bit_Chain dat = EMPTY_CHAIN (0);
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
printf ("usage: examples/bits "
|
||||
"001100000000000000000000000000011000000000000000100000001010010"
|
||||
"00\n");
|
||||
printf (
|
||||
"or examples/bits -x '8055 40f9 3284 d222 3e40 7436 e0d9 23fd'\n");
|
||||
return 1;
|
||||
}
|
||||
if (argc > 2 && !strcmp (argv[1], "-x"))
|
||||
{
|
||||
hex = 1;
|
||||
i = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = 1;
|
||||
}
|
||||
|
||||
// dat.chain = malloc (size + 1);
|
||||
// dat.size = size;
|
||||
dat.version = R_2004;
|
||||
do
|
||||
{
|
||||
char *input = argv[i];
|
||||
int bits = strlen (input);
|
||||
if (hex)
|
||||
dat.size += bits;
|
||||
else
|
||||
dat.size += bits / 8;
|
||||
dat.chain = realloc (dat.chain, dat.size + 1);
|
||||
if (hex)
|
||||
{
|
||||
int size = bit_write_hexbits (&dat, input);
|
||||
dat.size -= dat.size - size;
|
||||
}
|
||||
else
|
||||
bit_write_bits (&dat, input);
|
||||
i++;
|
||||
}
|
||||
while (i < argc);
|
||||
|
||||
pos = (int)bit_position (&dat);
|
||||
// accept all types, like CMC, BS, BL, HANDLE and print all possible variants
|
||||
pos = decode (&dat, 0, (int)pos);
|
||||
|
||||
free (dat.chain);
|
||||
return 0;
|
||||
}
|
||||
531
astral-service/static/lib/libredwg/examples/dwg2svg2.c
Normal file
531
astral-service/static/lib/libredwg/examples/dwg2svg2.c
Normal file
@@ -0,0 +1,531 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2013-2020,2023 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* dwg2svg2.c: convert a DWG to SVG via the API.
|
||||
if there are paperspace entities, only output them. else all modelspace
|
||||
entities.
|
||||
* written by Gaganjyot Singh
|
||||
* modified by Reini Urban
|
||||
*/
|
||||
|
||||
#include "../src/config.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#ifdef ENABLE_MIMALLOC
|
||||
# include <mimalloc-override.h>
|
||||
#endif
|
||||
|
||||
#include <dwg.h>
|
||||
#include <dwg_api.h>
|
||||
#include "geom.h"
|
||||
|
||||
static int opts = 0;
|
||||
static dwg_data g_dwg;
|
||||
static double model_xmin, model_ymin;
|
||||
static double page_width, page_height, scale;
|
||||
|
||||
static int
|
||||
usage (void)
|
||||
{
|
||||
printf ("\nUsage: dwg2svg2 [-v[0-9]] DWGFILE\n");
|
||||
return 1;
|
||||
}
|
||||
static int
|
||||
opt_version (void)
|
||||
{
|
||||
printf ("dwg2svg2 %s\n", PACKAGE_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
help (void)
|
||||
{
|
||||
printf ("\nUsage: dwg2svg2 [OPTION]... DWGFILE >file.svg\n");
|
||||
printf ("Example to use the DWG api\n"
|
||||
"\n");
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
printf (" -v[0-9], --verbose [0-9] verbosity\n");
|
||||
printf (" --help display this help and exit\n");
|
||||
printf (" --version output version information and exit\n"
|
||||
"\n");
|
||||
#else
|
||||
printf (" -v[0-9] verbosity\n");
|
||||
printf (" -h display this help and exit\n");
|
||||
printf (" -i output version information and exit\n"
|
||||
"\n");
|
||||
#endif
|
||||
printf ("GNU LibreDWG online manual: "
|
||||
"<https://www.gnu.org/software/libredwg/>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define log_if_error(msg) \
|
||||
if (error) \
|
||||
{ \
|
||||
fprintf (stderr, "ERROR: %s", msg); \
|
||||
exit (1); \
|
||||
}
|
||||
#define log_error(msg) \
|
||||
{ \
|
||||
fprintf (stderr, "ERROR: %s", msg); \
|
||||
exit (1); \
|
||||
}
|
||||
#define dynget(obj, name, field, var) \
|
||||
if (!dwg_dynapi_entity_value (obj, "" name, "" field, var, NULL)) \
|
||||
{ \
|
||||
fprintf (stderr, "ERROR: %s.%s", name, field); \
|
||||
exit (1); \
|
||||
}
|
||||
#define dynget_utf8(obj, name, field, var) \
|
||||
if (!dwg_dynapi_entity_utf8text (obj, "" name, "" field, var, &isnew, \
|
||||
NULL)) \
|
||||
{ \
|
||||
fprintf (stderr, "ERROR: %s.%s", name, field); \
|
||||
exit (1); \
|
||||
}
|
||||
|
||||
static double
|
||||
transform_X (double x)
|
||||
{
|
||||
return x - model_xmin;
|
||||
}
|
||||
|
||||
static double
|
||||
transform_Y (double y)
|
||||
{
|
||||
return page_height - (y - model_ymin);
|
||||
}
|
||||
|
||||
static void output_SVG (dwg_data *dwg);
|
||||
|
||||
static int
|
||||
test_SVG (char *filename)
|
||||
{
|
||||
int error;
|
||||
|
||||
memset (&g_dwg, 0, sizeof (dwg_data));
|
||||
g_dwg.opts = opts;
|
||||
error = dwg_read_file (filename, &g_dwg);
|
||||
if (error < DWG_ERR_CRITICAL)
|
||||
output_SVG (&g_dwg);
|
||||
|
||||
dwg_free (&g_dwg);
|
||||
/* This value is the return value for `main',
|
||||
so clamp it to either 0 or 1. */
|
||||
return error < DWG_ERR_CRITICAL ? 0 : 1;
|
||||
}
|
||||
|
||||
static void
|
||||
output_TEXT (dwg_object *obj)
|
||||
{
|
||||
int error, index;
|
||||
dwg_point_2d ins_pt;
|
||||
Dwg_Entity_TEXT *text;
|
||||
char *text_value;
|
||||
double fontsize;
|
||||
const Dwg_Version_Type dwg_version = obj->parent->header.version;
|
||||
int isnew = 0;
|
||||
|
||||
index = dwg_object_get_index (obj, &error);
|
||||
log_if_error ("object_get_index");
|
||||
text = dwg_object_to_TEXT (obj);
|
||||
if (!text)
|
||||
log_error ("dwg_object_to_TEXT");
|
||||
dynget_utf8 (text, "TEXT", "text_value", &text_value);
|
||||
dynget (text, "TEXT", "ins_pt", &ins_pt);
|
||||
dynget (text, "TEXT", "height", &fontsize);
|
||||
|
||||
printf ("\t<text id=\"dwg-object-%d\" x=\"%f\" y=\"%f\" "
|
||||
"font-family=\"Verdana\" font-size=\"%f\" fill=\"blue\">%s</text>\n",
|
||||
index, transform_X (ins_pt.x), transform_Y (ins_pt.y), fontsize,
|
||||
text_value);
|
||||
|
||||
if (text_value && isnew)
|
||||
free (text_value);
|
||||
}
|
||||
|
||||
static void
|
||||
output_LINE (dwg_object *obj)
|
||||
{
|
||||
int error, index;
|
||||
Dwg_Entity_LINE *line;
|
||||
dwg_point_3d start, end;
|
||||
|
||||
index = dwg_object_get_index (obj, &error);
|
||||
log_if_error ("object_get_index");
|
||||
line = dwg_object_to_LINE (obj);
|
||||
if (!line)
|
||||
log_error ("dwg_object_to_LINE");
|
||||
if (!dwg_get_LINE (line, "start", &start))
|
||||
log_error ("LINE.start");
|
||||
if (!dwg_get_LINE (line, "end", &end))
|
||||
log_error ("LINE.end");
|
||||
|
||||
printf ("\t<path id=\"dwg-object-%d\" d=\"M %f,%f %f,%f\" "
|
||||
"style=\"fill:none;stroke:blue;stroke-width:0.1px\" />\n",
|
||||
index, transform_X (start.x), transform_Y (start.y),
|
||||
transform_X (end.x), transform_Y (end.y));
|
||||
}
|
||||
|
||||
static void
|
||||
output_CIRCLE (dwg_object *obj)
|
||||
{
|
||||
Dwg_Entity_CIRCLE *circle;
|
||||
int error, index;
|
||||
double radius;
|
||||
dwg_point_3d center;
|
||||
|
||||
index = dwg_object_get_index (obj, &error);
|
||||
log_if_error ("object_get_index");
|
||||
circle = dwg_object_to_CIRCLE (obj);
|
||||
if (!circle)
|
||||
log_error ("dwg_object_to_CIRCLE");
|
||||
if (!dwg_get_CIRCLE (circle, "center", ¢er))
|
||||
log_error ("CIRCLE.center");
|
||||
if (!dwg_get_CIRCLE (circle, "radius", &radius))
|
||||
log_error ("CIRCLE.radius");
|
||||
|
||||
printf ("\t<circle id=\"dwg-object-%d\" cx=\"%f\" cy=\"%f\" r=\"%f\" "
|
||||
"fill=\"none\" stroke=\"blue\" stroke-width=\"0.1px\" />\n",
|
||||
index, transform_X (center.x), transform_Y (center.y), radius);
|
||||
}
|
||||
|
||||
static void
|
||||
output_ARC (dwg_object *obj)
|
||||
{
|
||||
Dwg_Entity_ARC *arc;
|
||||
int error, index;
|
||||
double radius, start_angle, end_angle;
|
||||
dwg_point_3d center;
|
||||
double x_start, y_start, x_end, y_end;
|
||||
int large_arc;
|
||||
|
||||
index = dwg_object_get_index (obj, &error);
|
||||
log_if_error ("object_get_index");
|
||||
arc = dwg_object_to_ARC (obj);
|
||||
if (!arc)
|
||||
log_error ("dwg_object_to_ARC");
|
||||
dynget (arc, "ARC", "radius", &radius);
|
||||
dynget (arc, "ARC", "center", ¢er);
|
||||
dynget (arc, "ARC", "start_angle", &start_angle);
|
||||
dynget (arc, "ARC", "end_angle", &end_angle);
|
||||
|
||||
x_start = center.x + radius * cos (start_angle);
|
||||
y_start = center.y + radius * sin (start_angle);
|
||||
x_end = center.x + radius * cos (end_angle);
|
||||
y_end = center.y + radius * sin (end_angle);
|
||||
// Assuming clockwise arcs.
|
||||
large_arc = (end_angle - start_angle < M_PI) ? 0 : 1;
|
||||
|
||||
printf ("\t<path id=\"dwg-object-%d\" d=\"M %f,%f A %f,%f 0 %d 0 %f,%f\" "
|
||||
"fill=\"none\" stroke=\"blue\" stroke-width=\"%f\" />\n",
|
||||
index, transform_X (x_start), transform_Y (y_start), radius, radius,
|
||||
large_arc, transform_X (x_end), transform_Y (y_end), 0.1);
|
||||
}
|
||||
|
||||
static void
|
||||
output_INSERT (dwg_object *obj)
|
||||
{
|
||||
int index, error;
|
||||
BITCODE_RL abs_ref;
|
||||
double rotation;
|
||||
dwg_ent_insert *insert;
|
||||
dwg_point_3d ins_pt, _scale;
|
||||
dwg_handle *obj_handle, *ins_handle;
|
||||
Dwg_Data *dwg;
|
||||
|
||||
insert = dwg_object_to_INSERT (obj);
|
||||
if (!insert)
|
||||
log_error ("dwg_object_to_INSERT");
|
||||
dwg = obj->parent;
|
||||
index = dwg_object_get_index (obj, &error);
|
||||
log_if_error ("object_get_index");
|
||||
dynget (insert, "INSERT", "rotation", &rotation);
|
||||
dynget (insert, "INSERT", "ins_pt", &ins_pt);
|
||||
dynget (insert, "INSERT", "scale", &_scale);
|
||||
obj_handle = dwg_object_get_handle (obj, &error);
|
||||
log_if_error ("get_handle");
|
||||
if (!insert->block_header)
|
||||
log_error ("insert->block_header");
|
||||
abs_ref = insert->block_header->absolute_ref;
|
||||
|
||||
if (insert->block_header->handleref.code == 5 || dwg->header.version < R_13)
|
||||
{
|
||||
printf ("\t<use id=\"dwg-object-%d\" transform=\"translate(%f %f) "
|
||||
"rotate(%f) scale(%f %f)\" xlink:href=\"#symbol-%X\" /><!-- "
|
||||
"block_header->handleref: " FORMAT_H " -->\n",
|
||||
index, transform_X (ins_pt.x), transform_Y (ins_pt.y),
|
||||
(180.0 / M_PI) * rotation, _scale.x, _scale.y, abs_ref,
|
||||
ARGS_H (*obj_handle));
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\n\n<!-- WRONG INSERT(" FORMAT_H ") -->\n",
|
||||
ARGS_H (*obj_handle));
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
output_object (dwg_object *obj)
|
||||
{
|
||||
int i = 0;
|
||||
if (!obj)
|
||||
{
|
||||
fprintf (stderr, "object is NULL\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dwg_object_get_fixedtype (obj) == DWG_TYPE_INSERT)
|
||||
{
|
||||
i++;
|
||||
output_INSERT (obj);
|
||||
}
|
||||
else if (dwg_object_get_fixedtype (obj) == DWG_TYPE_LINE)
|
||||
{
|
||||
i++;
|
||||
output_LINE (obj);
|
||||
}
|
||||
else if (dwg_object_get_fixedtype (obj) == DWG_TYPE_CIRCLE)
|
||||
{
|
||||
i++;
|
||||
output_CIRCLE (obj);
|
||||
}
|
||||
else if (dwg_object_get_fixedtype (obj) == DWG_TYPE_TEXT)
|
||||
{
|
||||
i++;
|
||||
output_TEXT (obj);
|
||||
}
|
||||
else if (dwg_object_get_fixedtype (obj) == DWG_TYPE_ARC)
|
||||
{
|
||||
i++;
|
||||
output_ARC (obj);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static int
|
||||
output_BLOCK_HEADER (dwg_object_ref *ref)
|
||||
{
|
||||
dwg_object *hdr, *obj;
|
||||
dwg_obj_block_header *_hdr;
|
||||
int error;
|
||||
BITCODE_RL abs_ref;
|
||||
char *name;
|
||||
int i = 0;
|
||||
|
||||
if (!ref)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"Empty BLOCK."
|
||||
" Could not output an SVG symbol for this BLOCK_HEADER\n");
|
||||
return 0;
|
||||
}
|
||||
hdr = dwg_ref_get_object (ref, &error);
|
||||
if (!hdr || error)
|
||||
{
|
||||
abs_ref = dwg_ref_get_absref (ref, &error);
|
||||
fprintf (stderr, "Failed to resolve BLOCK handle %X.\n",
|
||||
(unsigned)abs_ref);
|
||||
return 0;
|
||||
}
|
||||
abs_ref = dwg_ref_get_absref (ref, &error);
|
||||
|
||||
_hdr = dwg_object_to_BLOCK_HEADER (hdr);
|
||||
if (_hdr)
|
||||
{
|
||||
i++;
|
||||
dynget (_hdr, "BLOCK_HEADER", "name", &name);
|
||||
// name = dwg_obj_block_header_get_name (_hdr, &error);
|
||||
printf ("\t<g id=\"symbol-%X\" >\n\t\t<!-- %s -->\n",
|
||||
abs_ref ? abs_ref : 0, name ? name : "");
|
||||
if (name != NULL && name != _hdr->name
|
||||
&& hdr->parent->header.version >= R_2007)
|
||||
free (name);
|
||||
}
|
||||
else
|
||||
printf ("\t<g id=\"symbol-%X\" >\n\t\t<!-- ? -->\n",
|
||||
abs_ref ? abs_ref : 0);
|
||||
|
||||
obj = get_first_owned_entity (hdr);
|
||||
while (obj)
|
||||
{
|
||||
i += output_object (obj);
|
||||
obj = get_next_owned_entity (hdr, obj);
|
||||
}
|
||||
printf ("\t</g>\n");
|
||||
return i;
|
||||
}
|
||||
|
||||
static void
|
||||
output_SVG (dwg_data *dwg)
|
||||
{
|
||||
unsigned int i, num_hdr_objs;
|
||||
int error;
|
||||
dwg_obj_block_control *_ctrl;
|
||||
dwg_object_ref *hdr;
|
||||
dwg_object_ref **hdr_refs;
|
||||
dwg_object_ref *ms = dwg_model_space_ref (dwg);
|
||||
dwg_object_ref *ps = dwg_paper_space_ref (dwg);
|
||||
|
||||
double dx = dwg_model_x_max (dwg) - dwg_model_x_min (dwg);
|
||||
double dy = dwg_model_y_max (dwg) - dwg_model_y_min (dwg);
|
||||
double pdx = dwg->header_vars.PLIMMAX.x - dwg->header_vars.PLIMMIN.x;
|
||||
double pdy = dwg->header_vars.PLIMMAX.y - dwg->header_vars.PLIMMIN.y;
|
||||
double scale_x = dx / (pdx == 0.0 ? 1.0 : pdx);
|
||||
double scale_y = dy / (pdy == 0.0 ? 1.0 : pdy);
|
||||
scale = 25.4 / 72.0; // pt:mm TODO
|
||||
|
||||
model_xmin = dwg_model_x_min (dwg);
|
||||
model_ymin = dwg_model_y_min (dwg);
|
||||
page_width = dx;
|
||||
page_height = dy;
|
||||
scale *= (scale_x > scale_y ? scale_x : scale_y);
|
||||
|
||||
_ctrl = dwg_block_control (dwg);
|
||||
hdr_refs = dwg_obj_block_control_get_block_headers (_ctrl, &error);
|
||||
log_if_error ("block_control_get_block_headers");
|
||||
num_hdr_objs = dwg_obj_block_control_get_num_entries (_ctrl, &error);
|
||||
log_if_error ("block_control_get_num_entries");
|
||||
|
||||
printf ("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
||||
"<svg\n"
|
||||
" xmlns:svg=\"http://www.w3.org/2000/svg\"\n"
|
||||
" xmlns=\"http://www.w3.org/2000/svg\"\n"
|
||||
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"
|
||||
" version=\"1.1\"\n"
|
||||
" width=\"%f\"\n"
|
||||
" height=\"%f\"\n"
|
||||
">\n",
|
||||
page_width, page_height);
|
||||
|
||||
printf ("\t<defs>\n");
|
||||
for (i = 0; i < num_hdr_objs; i++)
|
||||
{
|
||||
hdr = hdr_refs[i];
|
||||
if (hdr == ms || hdr == ps)
|
||||
continue;
|
||||
output_BLOCK_HEADER (hdr_refs[i]);
|
||||
}
|
||||
printf ("\t</defs>\n");
|
||||
|
||||
if (ps)
|
||||
i = output_BLOCK_HEADER (ps);
|
||||
if (!ps || !i)
|
||||
output_BLOCK_HEADER (ms);
|
||||
free (hdr_refs);
|
||||
|
||||
printf ("</svg>\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int i = 1;
|
||||
int c;
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
int option_index = 0;
|
||||
static struct option long_options[]
|
||||
= { { "verbose", 1, &opts, 1 }, // optional
|
||||
{ "help", 0, 0, 0 },
|
||||
{ "version", 0, 0, 0 },
|
||||
{ NULL, 0, NULL, 0 } };
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
return usage ();
|
||||
|
||||
while
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
((c = getopt_long (argc, argv, ":v::h", long_options, &option_index))
|
||||
!= -1)
|
||||
#else
|
||||
((c = getopt (argc, argv, ":v::hi")) != -1)
|
||||
#endif
|
||||
{
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c)
|
||||
{
|
||||
case ':': // missing arg
|
||||
if (optarg && !strcmp (optarg, "v"))
|
||||
{
|
||||
opts = 1;
|
||||
break;
|
||||
}
|
||||
fprintf (stderr, "%s: option '-%c' requires an argument\n", argv[0],
|
||||
optopt);
|
||||
break;
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
case 0:
|
||||
/* This option sets a flag */
|
||||
if (!strcmp (long_options[option_index].name, "verbose"))
|
||||
{
|
||||
if (opts < 0 || opts > 9)
|
||||
return usage ();
|
||||
# if defined(USE_TRACING) && defined(HAVE_SETENV)
|
||||
{
|
||||
char v[2];
|
||||
*v = opts + '0';
|
||||
*(v + 1) = 0;
|
||||
setenv ("LIBREDWG_TRACE", v, 1);
|
||||
}
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
if (!strcmp (long_options[option_index].name, "version"))
|
||||
return opt_version ();
|
||||
if (!strcmp (long_options[option_index].name, "help"))
|
||||
return help ();
|
||||
break;
|
||||
#else
|
||||
case 'i':
|
||||
return opt_version ();
|
||||
#endif
|
||||
case 'v': // support -v3 and -v
|
||||
i = (optind > 0 && optind < argc) ? optind - 1 : 1;
|
||||
if (!memcmp (argv[i], "-v", 2))
|
||||
{
|
||||
opts = argv[i][2] ? argv[i][2] - '0' : 1;
|
||||
}
|
||||
if (opts < 0 || opts > 9)
|
||||
return usage ();
|
||||
#if defined(USE_TRACING) && defined(HAVE_SETENV)
|
||||
{
|
||||
char v[2];
|
||||
*v = opts + '0';
|
||||
*(v + 1) = 0;
|
||||
setenv ("LIBREDWG_TRACE", v, 1);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 'h':
|
||||
return help ();
|
||||
case '?':
|
||||
fprintf (stderr, "%s: invalid option '-%c' ignored\n", argv[0],
|
||||
optopt);
|
||||
break;
|
||||
default:
|
||||
return usage ();
|
||||
}
|
||||
}
|
||||
i = optind;
|
||||
if (i >= argc)
|
||||
return usage ();
|
||||
|
||||
return test_SVG (argv[i]);
|
||||
}
|
||||
BIN
astral-service/static/lib/libredwg/examples/dwg2svg2.exe
Normal file
BIN
astral-service/static/lib/libredwg/examples/dwg2svg2.exe
Normal file
Binary file not shown.
2150
astral-service/static/lib/libredwg/examples/dwgadd.c
Normal file
2150
astral-service/static/lib/libredwg/examples/dwgadd.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
astral-service/static/lib/libredwg/examples/dwgadd.exe
Normal file
BIN
astral-service/static/lib/libredwg/examples/dwgadd.exe
Normal file
Binary file not shown.
821
astral-service/static/lib/libredwg/examples/dwgfuzz.c
Normal file
821
astral-service/static/lib/libredwg/examples/dwgfuzz.c
Normal file
@@ -0,0 +1,821 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2020 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* dwgfuzz.c: afl++/honggfuzz fuzzing for all in- and exporters. Just not the
|
||||
separate ones.
|
||||
*
|
||||
* Also usable like:
|
||||
../configure --disable-shared --disable-bindings CC=hfuzz-clang CFLAGS='-O2
|
||||
-g -fsanitize=address,undefined -fno-omit-frame-pointer -I/usr/local/include'
|
||||
&& make -C src && make -C examples dwgfuzz honggfuzz -i ../.fuzz-in-dxf --
|
||||
examples/dwgfuzz -indxf ___FILE___
|
||||
|
||||
* Also useful for debugging the fuzzers.
|
||||
AFL_DONT_OPTIMIZE=1 AFL_LLVM_INSTRIM=1 AFL_USE_ASAN=1 make -C examples
|
||||
dwgfuzz V=1 AFL_DEBUG=15 AFL_DEBUG_CHILD_OUTPUT=1 gdb --args afl-fuzz -m none
|
||||
-i ../.fuzz-in-dxf/ -o .fuzz-out/ examples/dwgfuzz (gdb) set follow-fork-mode
|
||||
child
|
||||
* written by Reini Urban
|
||||
*/
|
||||
|
||||
#include "../src/config.h"
|
||||
#ifdef HAVE_SSCANF_S
|
||||
# define __STDC_WANT_LIB_EXT1__ 1
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <dwg.h>
|
||||
#include <dwg_api.h>
|
||||
#include "common.h"
|
||||
#include "decode.h"
|
||||
#include "encode.h"
|
||||
#include "bits.h"
|
||||
#ifndef DISABLE_DXF
|
||||
# include "out_dxf.h"
|
||||
# ifndef DISABLE_JSON
|
||||
# include "in_json.h"
|
||||
# include "out_json.h"
|
||||
# endif
|
||||
# include "in_dxf.h"
|
||||
#endif
|
||||
|
||||
#define FUZZ_INMEM 0
|
||||
#define FUZZ_STDIN 1
|
||||
#define FUZZ_FILE 2
|
||||
|
||||
// defined by ./make-afl-clang-fast.sh for INMEM. defaults to FILE for
|
||||
// debugging
|
||||
#ifndef FUZZ_MODE
|
||||
# define FUZZ_MODE FUZZ_INMEM
|
||||
//#define FUZZ_MODE FUZZ_STDIN
|
||||
//#define FUZZ_MODE FUZZ_FILE
|
||||
#endif
|
||||
|
||||
int dwg_fuzz_dat (Dwg_Data **restrict dwgp, Bit_Chain *restrict dat);
|
||||
|
||||
static int
|
||||
version (void)
|
||||
{
|
||||
printf ("dwgfuzz %s INMEM\n", PACKAGE_VERSION);
|
||||
#ifndef __AFL_COMPILER
|
||||
printf ("not instrumented\n");
|
||||
#else
|
||||
# ifdef __AFL_FUZZ_TESTCASE_BUF
|
||||
printf ("shared-memory instrumented\n");
|
||||
# else
|
||||
printf ("instrumented\n");
|
||||
# endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef __AFL_COMPILER
|
||||
# define __AFL_FUZZ_INIT()
|
||||
# if FUZZ_MODE == FUZZ_INMEM
|
||||
unsigned char *__AFL_FUZZ_TESTCASE_BUF;
|
||||
unsigned long __AFL_FUZZ_TESTCASE_LEN;
|
||||
# define __AFL_INIT() \
|
||||
fp = fopen (argv[2], "rb"); \
|
||||
if (!fp) \
|
||||
return 0; \
|
||||
__AFL_FUZZ_TESTCASE_LEN = dat.size; \
|
||||
dat_read_file (&dat, fp, argv[2]); \
|
||||
__AFL_FUZZ_TESTCASE_BUF = dat.chain;
|
||||
# else
|
||||
# define __AFL_INIT()
|
||||
# endif
|
||||
# define __AFL_FUZZ_TESTCASE_LEN dat.size
|
||||
# define __AFL_LOOP(i) 1
|
||||
#endif
|
||||
|
||||
__AFL_FUZZ_INIT ();
|
||||
|
||||
static int
|
||||
help (void)
|
||||
{
|
||||
#if FUZZ_MODE == FUZZ_FILE
|
||||
printf ("\nUsage: dwgfuzz MODE @@\n");
|
||||
#elif !defined __AFL_COMPILER
|
||||
printf ("\nUsage: dwgfuzz MODE ../.fuzz-in/INFILE\n");
|
||||
#else
|
||||
printf ("\nUsage: dwgfuzz MODE\n");
|
||||
#endif
|
||||
printf ("afl++ clang-fast shared-memory backend, using many importers and "
|
||||
"exporters.\n"
|
||||
"\n");
|
||||
printf ("MODE:\n");
|
||||
#ifdef USE_WRITE
|
||||
# ifndef DISABLE_DXF
|
||||
printf (" -indxf: import from DXF, export as r2000 DWG\n");
|
||||
# endif
|
||||
# ifndef DISABLE_JSON
|
||||
printf (" -injson: import from JSON, export as r2000 DWG\n");
|
||||
# endif
|
||||
printf (" -rw: import from DWG, export as r2000 DWG, re-import from "
|
||||
"this DWG (rewrite)\n");
|
||||
printf (" -add: import from special add file, export as DWG and DXF, "
|
||||
"re-import from this\n");
|
||||
#endif
|
||||
printf (" -dwg: import from DWG only\n");
|
||||
#ifndef DISABLE_DXF
|
||||
printf (" -dxf: import from DWG, export as DXF\n");
|
||||
printf (" -dxfb: import from DWG, export as binary DXF\n");
|
||||
#endif
|
||||
#ifndef DISABLE_JSON
|
||||
printf (" -json: import from DWG, export as JSON\n");
|
||||
printf (" -geojson: import from DWG, export as GeoJSON\n");
|
||||
#endif
|
||||
printf ("\n"
|
||||
" --version display the version and exit\n");
|
||||
printf (" --help display this help and exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// for LLVMFuzzerTestOneInput see llvmfuzz.c
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int i = 0;
|
||||
Dwg_Data dwg;
|
||||
Bit_Chain dat = { 0 };
|
||||
Bit_Chain out_dat = { 0 };
|
||||
FILE *fp;
|
||||
struct stat attrib;
|
||||
enum
|
||||
{
|
||||
INVALID,
|
||||
DWG,
|
||||
#if defined(USE_WRITE) && !defined(DISABLE_DXF)
|
||||
INDXF,
|
||||
#endif
|
||||
#if defined(USE_WRITE) && !defined(DISABLE_JSON)
|
||||
INJSON,
|
||||
#endif
|
||||
#if defined(USE_WRITE)
|
||||
RW,
|
||||
ADD,
|
||||
#endif
|
||||
#if !defined(DISABLE_DXF)
|
||||
DXF,
|
||||
DXFB,
|
||||
#endif
|
||||
#if !defined(DISABLE_JSON)
|
||||
JSON,
|
||||
GEOJSON,
|
||||
#endif
|
||||
} mode
|
||||
= INVALID;
|
||||
__AFL_INIT ();
|
||||
|
||||
if (argc <= 1 || !*argv[1])
|
||||
return 1;
|
||||
if (strEQc (argv[1], "-dwg"))
|
||||
mode = DWG;
|
||||
#ifdef USE_WRITE
|
||||
# ifndef DISABLE_DXF
|
||||
else if (strEQc (argv[1], "-indxf"))
|
||||
mode = INDXF;
|
||||
# endif
|
||||
# ifndef DISABLE_JSON
|
||||
else if (strEQc (argv[1], "-injson"))
|
||||
mode = INJSON;
|
||||
# endif
|
||||
else if (strEQc (argv[1], "-rw"))
|
||||
mode = RW;
|
||||
else if (strEQc (argv[1], "-add"))
|
||||
mode = ADD;
|
||||
#endif /* USE_WRITE */
|
||||
#ifndef DISABLE_DXF
|
||||
else if (strEQc (argv[1], "-dxf"))
|
||||
mode = DXF;
|
||||
else if (strEQc (argv[1], "-dxfb"))
|
||||
mode = DXFB;
|
||||
#endif
|
||||
#ifndef DISABLE_JSON
|
||||
else if (strEQc (argv[1], "-json"))
|
||||
mode = JSON;
|
||||
else if (strEQc (argv[1], "-geojson"))
|
||||
mode = GEOJSON;
|
||||
#endif
|
||||
else if (strEQc (argv[1], "--version"))
|
||||
return version ();
|
||||
else if (strEQc (argv[1], "--help"))
|
||||
return help ();
|
||||
else
|
||||
return 1;
|
||||
if (mode == INVALID)
|
||||
return 1;
|
||||
#if FUZZ_MODE == FUZZ_FILE
|
||||
if (argc <= 2 || !*argv[2])
|
||||
return 1;
|
||||
#endif
|
||||
#if FUZZ_MODE == FUZZ_INMEM && !defined(__AFL_COMPILER)
|
||||
if (argc <= 2 || !*argv[2])
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
memset (&dwg, 0, sizeof (dwg));
|
||||
dat.chain = NULL;
|
||||
// dat.opts = 3;;
|
||||
#if FUZZ_MODE == FUZZ_INMEM
|
||||
dat.chain = __AFL_FUZZ_TESTCASE_BUF;
|
||||
#endif
|
||||
|
||||
while (__AFL_LOOP (10000))
|
||||
{ // llvm_mode persistent, non-forking mode
|
||||
i++;
|
||||
#ifndef __AFL_COMPILER
|
||||
# ifdef USE_WRITE
|
||||
if (mode == ADD && i > 1)
|
||||
break;
|
||||
# endif
|
||||
if (i > 3)
|
||||
break;
|
||||
#endif
|
||||
#if FUZZ_MODE == FUZZ_INMEM
|
||||
// fastest mode via shared mem
|
||||
if (!dat.chain)
|
||||
dat.chain = __AFL_FUZZ_TESTCASE_BUF;
|
||||
dat.size = __AFL_FUZZ_TESTCASE_LEN;
|
||||
printf ("Fuzzing from shared memory (%" PRIuSIZE ")\n", dat.size);
|
||||
#elif FUZZ_MODE == FUZZ_STDIN
|
||||
// still 10x faster than the old file-forking fuzzer.
|
||||
dat.size = 0;
|
||||
// dat.chain = NULL;
|
||||
dat_read_stream (&dat, stdin);
|
||||
printf ("Fuzzing from stdin (%" PRIuSIZE ")\n", dat.size);
|
||||
#elif FUZZ_MODE == FUZZ_FILE
|
||||
dat.size = 0;
|
||||
fp = fopen (argv[2], "rb");
|
||||
if (!fp)
|
||||
return 0;
|
||||
dat_read_file (&dat, fp, argv[2]);
|
||||
fclose (fp);
|
||||
printf ("Fuzzing from file (%" PRIuSIZE ")\n", dat.size);
|
||||
#else
|
||||
# error Missing FUZZ_MODE
|
||||
#endif
|
||||
if (dat.size == 0)
|
||||
exit (1);
|
||||
if (dat.size < 100)
|
||||
continue; // useful minimum input length
|
||||
memset (&out_dat, 0, sizeof (out_dat));
|
||||
bit_chain_set_version (&out_dat, &dat);
|
||||
#ifdef _WIN32
|
||||
out_dat.fh = fopen ("NUL", "w");
|
||||
#else
|
||||
out_dat.fh = fopen ("/dev/null", "w");
|
||||
#endif
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case DWG:
|
||||
if (dwg_decode (&dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
break;
|
||||
#if defined(USE_WRITE) && !defined(DISABLE_DXF)
|
||||
case INDXF:
|
||||
if (dwg_read_dxf (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
out_dat.version = R_2000;
|
||||
if (dwg_encode (&dwg, &out_dat) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
free (out_dat.chain);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if defined(USE_WRITE)
|
||||
case RW:
|
||||
if (dwg_decode (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
out_dat.version = R_2000;
|
||||
if (dwg_encode (&dwg, &out_dat) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
if (dwg_decode (&out_dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
free (out_dat.chain);
|
||||
}
|
||||
break;
|
||||
case ADD:
|
||||
{
|
||||
Dwg_Data *dwgp = &dwg;
|
||||
if (dwg_fuzz_dat (&dwgp, &dat) == 0)
|
||||
{
|
||||
int error;
|
||||
out_dat.byte = 0;
|
||||
out_dat.bit = 0;
|
||||
out_dat.from_version = dwg.header.from_version;
|
||||
out_dat.version = dwg.header.version;
|
||||
out_dat.opts = dwg.opts;
|
||||
error = dwg_encode (&dwg, &out_dat); // dwg -> out_dat
|
||||
if (error >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
|
||||
out_dat.byte = 0;
|
||||
out_dat.bit = 0;
|
||||
memset (&dwg, 0, sizeof (Dwg_Data));
|
||||
error = dwg_decode (&out_dat, &dwg); // out_dat -> dwg
|
||||
if (error >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if defined(USE_WRITE) && !defined(DISABLE_JSON)
|
||||
case INJSON:
|
||||
if (dwg_read_json (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
out_dat.version = R_2000;
|
||||
if (dwg_encode (&dwg, &out_dat) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifndef DISABLE_DXF
|
||||
case DXF:
|
||||
if (dwg_decode (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (dwg_write_dxf (&out_dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
case DXFB:
|
||||
if (dwg_decode (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (dwg_write_dxfb (&out_dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifndef DISABLE_JSON
|
||||
case JSON:
|
||||
if (dwg_decode (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (dwg_write_json (&out_dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
case GEOJSON:
|
||||
if (dwg_decode (&dat, &dwg) < DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (dwg_write_geojson (&out_dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case INVALID:
|
||||
default:
|
||||
exit (1);
|
||||
}
|
||||
free (out_dat.chain);
|
||||
fclose (out_dat.fh);
|
||||
}
|
||||
dwg_free (&dwg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(USE_WRITE)
|
||||
|
||||
static dwg_point_2d *
|
||||
scan_pts2d (unsigned num_pts, char **pp)
|
||||
{
|
||||
char *p = *pp;
|
||||
dwg_point_2d *pts;
|
||||
|
||||
p = strchr (p, '(');
|
||||
if (!p)
|
||||
return NULL;
|
||||
p++;
|
||||
if (num_pts > 5000)
|
||||
exit (0);
|
||||
pts = calloc (num_pts, 16);
|
||||
if (!pts)
|
||||
exit (0);
|
||||
for (unsigned i = 0; i < num_pts; i++)
|
||||
{
|
||||
if (sscanf (p, "(%lf %lf)", &pts[i].x, &pts[i].y))
|
||||
{
|
||||
p = strchr (p, ')');
|
||||
if (!p)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pp = p;
|
||||
p = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (p)
|
||||
{
|
||||
*pp = p;
|
||||
return pts;
|
||||
}
|
||||
else
|
||||
{
|
||||
free (pts);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static dwg_point_3d *
|
||||
scan_pts3d (unsigned num_pts, char **pp)
|
||||
{
|
||||
char *p = *pp;
|
||||
dwg_point_3d *pts;
|
||||
|
||||
p = strchr (p, '(');
|
||||
if (!p)
|
||||
return NULL;
|
||||
p++;
|
||||
if (num_pts > 5000)
|
||||
exit (0);
|
||||
pts = calloc (num_pts, 24);
|
||||
if (!pts)
|
||||
exit (0);
|
||||
for (unsigned i = 0; i < num_pts; i++)
|
||||
{
|
||||
if (sscanf (p, "(%lf %lf %lf)", &pts[i].x, &pts[i].y, &pts[i].z))
|
||||
{
|
||||
p = strchr (p, ')');
|
||||
if (!p)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pp = p;
|
||||
p = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (p && num_pts)
|
||||
{
|
||||
*pp = p;
|
||||
return pts;
|
||||
}
|
||||
else
|
||||
{
|
||||
free (pts);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
next_line (char *restrict p, const char *restrict end)
|
||||
{
|
||||
while (p < end && *p != '\n')
|
||||
p++;
|
||||
if (p < end)
|
||||
p++;
|
||||
return p;
|
||||
}
|
||||
|
||||
int
|
||||
dwg_fuzz_dat (Dwg_Data **restrict dwgp, Bit_Chain *restrict dat)
|
||||
{
|
||||
Dwg_Data *dwg;
|
||||
Dwg_Object *mspace;
|
||||
Dwg_Object_Ref *mspace_ref;
|
||||
Dwg_Object_BLOCK_HEADER *hdr;
|
||||
const char *end;
|
||||
char *p;
|
||||
Dwg_Version_Type version = R_INVALID;
|
||||
int i = 0;
|
||||
int imperial = 0;
|
||||
BITCODE_BL orig_num;
|
||||
|
||||
if (!dat->chain)
|
||||
abort ();
|
||||
end = (char *)&dat->chain[dat->size - 1];
|
||||
if ((p = strstr ((char *)dat->chain, "\nimperial\n")))
|
||||
{
|
||||
imperial = 1;
|
||||
p += strlen ("\nimperial\n");
|
||||
}
|
||||
if ((p = strstr ((char *)dat->chain, "version")))
|
||||
{
|
||||
int i_ver;
|
||||
char s_ver[16];
|
||||
i = sscanf (p, "version %d", &i_ver);
|
||||
if (i)
|
||||
{
|
||||
snprintf (s_ver, 16, "r%d", i_ver);
|
||||
s_ver[15] = '\0';
|
||||
version = dwg_version_as (s_ver);
|
||||
p += strlen ("version ");
|
||||
}
|
||||
else
|
||||
p += strlen ("version ");
|
||||
p = next_line (p, end);
|
||||
}
|
||||
if (!i || version >= R_AFTER)
|
||||
version = R_2000;
|
||||
|
||||
dwg = dwg_new_Document (version, imperial, 0);
|
||||
*dwgp = dwg;
|
||||
mspace = dwg_model_space_object (dwg);
|
||||
mspace_ref = dwg_model_space_ref (dwg);
|
||||
hdr = mspace->tio.object->tio.BLOCK_HEADER;
|
||||
orig_num = dwg->num_objects;
|
||||
|
||||
// read dat line by line and call the matching add API
|
||||
while (p && p < end)
|
||||
{
|
||||
char text[120], s1[120];
|
||||
dwg_point_2d p2, p3, p4;
|
||||
dwg_point_3d pt1, pt2, pt3, pt4, scale;
|
||||
double height, rot, len, f1, f2;
|
||||
int i1, i2;
|
||||
unsigned u;
|
||||
Dwg_Entity_VIEWPORT *viewport = NULL;
|
||||
Dwg_Entity_MTEXT *mtext = NULL;
|
||||
Dwg_Object_DICTIONARY *dictionary = NULL;
|
||||
Dwg_Object_XRECORD *xrecord = NULL;
|
||||
Dwg_Object_MLINESTYLE *mlinestyle = NULL;
|
||||
Dwg_Object_DIMSTYLE *dimstyle = NULL;
|
||||
Dwg_Object_UCS *ucs = NULL;
|
||||
Dwg_Object_LAYOUT *layout = NULL;
|
||||
|
||||
// accepts only ASCII strings, for fuzzing only
|
||||
# ifdef HAVE_SSCANF_S
|
||||
# define SSCANF_S sscanf_s
|
||||
# define SZ , 119
|
||||
# define FMT_NAME "%[a-zA-Z0-9_]"
|
||||
# define FMT_TBL "\"%[a-zA-Z0-9._ -]\""
|
||||
# define FMT_PATH "\"%[a-zA-Z0-9_. \\-]\""
|
||||
# define FMT_ANY "\"%s\""
|
||||
# else
|
||||
# define SSCANF_S sscanf
|
||||
# define SZ
|
||||
# define FMT_NAME "%119[a-zA-Z0-9_]"
|
||||
# define FMT_TBL "\"%119[a-zA-Z0-9._ -]\""
|
||||
# define FMT_PATH "\"%119[a-zA-Z0-9_. \\-]\""
|
||||
# define FMT_ANY "\"%119s\""
|
||||
# endif
|
||||
|
||||
# define SET_ENT(var, name) \
|
||||
if (!var) \
|
||||
; \
|
||||
else if (SSCANF_S (p, #var "." FMT_NAME " = %d", &s1[0] SZ, &i1)) \
|
||||
dwg_dynapi_entity_set_value (var, #name, s1, &i1, 0); \
|
||||
else if (SSCANF_S (p, #var "." FMT_NAME " = %lf", &s1[0] SZ, &f1)) \
|
||||
dwg_dynapi_entity_set_value (var, #name, s1, &f1, 0); \
|
||||
else if (SSCANF_S (p, #var "." FMT_NAME " = " FMT_ANY, &s1[0] SZ, \
|
||||
&text[0] SZ)) \
|
||||
dwg_dynapi_entity_set_value (var, #name, s1, text, 1)
|
||||
|
||||
if (SSCANF_S (p, "line (%lf %lf %lf) (%lf %lf %lf)", &pt1.x, &pt1.y,
|
||||
&pt1.z, &pt2.x, &pt2.y, &pt2.z))
|
||||
dwg_add_LINE (hdr, &pt1, &pt2);
|
||||
else if (SSCANF_S (p, "ray (%lf %lf %lf) (%lf %lf %lf)", &pt1.x, &pt1.y,
|
||||
&pt1.z, &pt2.x, &pt2.y, &pt2.z))
|
||||
dwg_add_RAY (hdr, &pt1, &pt2);
|
||||
else if (SSCANF_S (p, "xline (%lf %lf %lf) (%lf %lf %lf)", &pt1.x,
|
||||
&pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z))
|
||||
dwg_add_XLINE (hdr, &pt1, &pt2);
|
||||
else if (SSCANF_S (p, "text " FMT_ANY " (%lf %lf %lf) %lf", &text[0] SZ,
|
||||
&pt1.x, &pt1.y, &pt1.z, &height))
|
||||
dwg_add_TEXT (hdr, text, &pt1, height);
|
||||
else if (SSCANF_S (p, "mtext (%lf %lf %lf) %lf " FMT_ANY, &pt1.x, &pt1.y,
|
||||
&pt1.z, &height, &text[0] SZ))
|
||||
mtext = dwg_add_MTEXT (hdr, &pt1, height, text);
|
||||
else
|
||||
SET_ENT (mtext, MTEXT);
|
||||
else if (SSCANF_S (p, "block " FMT_TBL, &text[0] SZ))
|
||||
dwg_add_BLOCK (hdr, text);
|
||||
else if (memBEGINc (p, "endblk\n")) dwg_add_ENDBLK (hdr);
|
||||
else if (SSCANF_S (p, "insert (%lf %lf %lf) " FMT_TBL " %lf %lf %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &text[0] SZ, &scale.x,
|
||||
&scale.y, &scale.z, &rot))
|
||||
dwg_add_INSERT (hdr, &pt1, text, scale.x, scale.y, scale.z,
|
||||
deg2rad (rot));
|
||||
else if (SSCANF_S (p,
|
||||
"minsert (%lf %lf %lf) " FMT_TBL
|
||||
" %lf %lf %lf %lf %d %d "
|
||||
"%lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &text[0] SZ, &scale.x,
|
||||
&scale.y, &scale.z, &rot, &i1, &i2, &f1, &f2))
|
||||
dwg_add_MINSERT (hdr, &pt1, text, scale.x, scale.y, scale.z,
|
||||
deg2rad (rot), i1, i2, f1, f2);
|
||||
else if (SSCANF_S (p, "point (%lf %lf %lf)", &pt1.x, &pt1.y, &pt1.z))
|
||||
dwg_add_POINT (hdr, &pt1);
|
||||
else if (SSCANF_S (p, "circle (%lf %lf %lf) %lf", &pt1.x, &pt1.y, &pt1.z,
|
||||
&f1)) dwg_add_CIRCLE (hdr, &pt1, f1);
|
||||
else if (SSCANF_S (p, "arc (%lf %lf %lf) %lf %lf %lf", &pt1.x, &pt1.y,
|
||||
&pt1.z, &f1, &f2, &height))
|
||||
dwg_add_ARC (hdr, &pt1, f1, f2, height);
|
||||
else if (SSCANF_S (p,
|
||||
"dimension_aligned (%lf %lf %lf) (%lf %lf %lf) (%lf "
|
||||
"%lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z,
|
||||
&pt3.x, &pt3.y, &pt3.z))
|
||||
dwg_add_DIMENSION_ALIGNED (hdr, &pt1, &pt2, &pt3);
|
||||
else if (SSCANF_S (
|
||||
p,
|
||||
"dimension_linear (%lf %lf %lf) (%lf %lf %lf) (%lf %lf "
|
||||
"%lf) %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &pt3.x,
|
||||
&pt3.y, &pt3.z, &rot))
|
||||
dwg_add_DIMENSION_LINEAR (hdr, &pt1, &pt2, &pt3, deg2rad (rot));
|
||||
else if (SSCANF_S (
|
||||
p,
|
||||
"dimension_ang2ln (%lf %lf %lf) (%lf %lf %lf) (%lf %lf "
|
||||
"%lf) (%lf %lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &pt3.x,
|
||||
&pt3.y, &pt3.z, &pt4.x, &pt4.y, &pt4.z))
|
||||
dwg_add_DIMENSION_ANG2LN (hdr, &pt1, &pt2, &pt3, &pt4);
|
||||
else if (SSCANF_S (
|
||||
p,
|
||||
"dimension_ang3pt (%lf %lf %lf) (%lf %lf %lf) (%lf %lf "
|
||||
"%lf) (%lf %lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &pt3.x,
|
||||
&pt3.y, &pt3.z, &pt4.x, &pt4.y, &pt4.z))
|
||||
dwg_add_DIMENSION_ANG3PT (hdr, &pt1, &pt2, &pt3, &pt4);
|
||||
else if (SSCANF_S (p,
|
||||
"dimension_diameter (%lf %lf %lf) (%lf %lf %lf) %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &len))
|
||||
dwg_add_DIMENSION_DIAMETER (hdr, &pt1, &pt2, len);
|
||||
else if (SSCANF_S (p,
|
||||
"dimension_ordinate (%lf %lf %lf) (%lf %lf %lf) %d",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &i1))
|
||||
dwg_add_DIMENSION_ORDINATE (hdr, &pt1, &pt2, i1 ? true : false);
|
||||
else if (SSCANF_S (p, "dimension_radius (%lf %lf %lf) (%lf %lf %lf) %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &len))
|
||||
dwg_add_DIMENSION_RADIUS (hdr, &pt1, &pt2, len);
|
||||
else if (SSCANF_S (p,
|
||||
"3dface (%lf %lf %lf) (%lf %lf %lf) (%lf %lf "
|
||||
"%lf) (%lf %lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z,
|
||||
&pt3.x, &pt3.y, &pt3.z, &pt4.x, &pt4.y, &pt4.z))
|
||||
dwg_add_3DFACE (hdr, &pt1, &pt2, &pt3, &pt4);
|
||||
else if (SSCANF_S (p,
|
||||
"3dface (%lf %lf %lf) (%lf %lf %lf) (%lf %lf "
|
||||
"%lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z,
|
||||
&pt3.x, &pt3.y, &pt3.z))
|
||||
dwg_add_3DFACE (hdr, &pt1, &pt2, &pt3, NULL);
|
||||
else if (SSCANF_S (
|
||||
p, "solid (%lf %lf %lf) (%lf %lf) (%lf %lf) (%lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &p2.x, &p2.y, &p3.x, &p3.y, &p4.x,
|
||||
&p4.y)) dwg_add_SOLID (hdr, &pt1, &p2, &p3, &p4);
|
||||
else if (SSCANF_S (
|
||||
p, "trace (%lf %lf %lf) (%lf %lf) (%lf %lf) (%lf %lf)",
|
||||
&pt1.x, &pt1.y, &pt1.z, &p2.x, &p2.y, &p3.x, &p3.y, &p4.x,
|
||||
&p4.y)) dwg_add_TRACE (hdr, &pt1, &p2, &p3, &p4);
|
||||
else if (SSCANF_S (p, "polyline_2d %d ((%lf %lf)", &i1, &pt1.x, &pt1.y))
|
||||
{
|
||||
dwg_point_2d *pts = scan_pts2d (i1, &p);
|
||||
if (i1 && pts)
|
||||
{
|
||||
dwg_add_POLYLINE_2D (hdr, i1, pts);
|
||||
free (pts);
|
||||
}
|
||||
}
|
||||
else if (SSCANF_S (p, "polyline_3d %d ((%lf %lf %lf)", &i1, &pt1.x,
|
||||
&pt1.y, &pt1.z))
|
||||
{
|
||||
dwg_point_3d *pts = scan_pts3d (i1, &p);
|
||||
if (i1 && pts)
|
||||
{
|
||||
dwg_add_POLYLINE_3D (hdr, i1, pts);
|
||||
free (pts);
|
||||
}
|
||||
}
|
||||
else if (SSCANF_S (p, "polyline_mesh %d %d ((%lf %lf %lf)", &i1, &i2,
|
||||
&pt1.x, &pt1.y, &pt1.z))
|
||||
{
|
||||
dwg_point_3d *pts = scan_pts3d (i1 * i2, &p);
|
||||
if (i1 && i2 && pts)
|
||||
{
|
||||
dwg_add_POLYLINE_MESH (hdr, i1, i2, pts);
|
||||
free (pts);
|
||||
}
|
||||
}
|
||||
else if (SSCANF_S (p, "dictionary " FMT_TBL " " FMT_TBL " %u",
|
||||
&text[0] SZ, &s1[0] SZ, &u)) dictionary
|
||||
= dwg_add_DICTIONARY (dwg, text, s1, (unsigned long)u);
|
||||
else if (dictionary
|
||||
&& SSCANF_S (p, "xrecord dictionary " FMT_TBL, &text[0] SZ))
|
||||
xrecord
|
||||
= dwg_add_XRECORD (dictionary, text);
|
||||
else if (SSCANF_S (p, "shape " FMT_PATH " (%lf %lf %lf) %lf %lf",
|
||||
&text[0] SZ, &pt1.x, &pt1.y, &pt1.z, &scale.x, &rot))
|
||||
dwg_add_SHAPE (hdr, text, &pt1, scale.x, deg2rad (rot));
|
||||
else if (SSCANF_S (p, "viewport " FMT_TBL, &text[0] SZ)) viewport
|
||||
= dwg_add_VIEWPORT (hdr, text);
|
||||
else SET_ENT (viewport, VIEWPORT);
|
||||
else if (SSCANF_S (p, "ellipse (%lf %lf %lf) %lf %lf", &pt1.x, &pt1.y,
|
||||
&pt1.z, &f1, &f2))
|
||||
dwg_add_ELLIPSE (hdr, &pt1, f1, f2);
|
||||
else if (SSCANF_S (p, "spline %d ((%lf %lf %lf)", &i1, &pt1.x, &pt1.y,
|
||||
&pt1.z))
|
||||
{
|
||||
dwg_point_3d *fitpts = scan_pts3d (i1, &p);
|
||||
if (i1 && fitpts
|
||||
&& sscanf (p, ") (%lf %lf %lf) (%lf %lf %lf)", &pt2.x, &pt2.y,
|
||||
&pt2.z, &pt3.x, &pt3.y, &pt3.z))
|
||||
{
|
||||
dwg_add_SPLINE (hdr, i1, fitpts, &pt2, &pt3);
|
||||
}
|
||||
free (fitpts);
|
||||
}
|
||||
else if (mtext
|
||||
&& sscanf (p, "leader %d ((%lf %lf %lf)", &i1, &pt1.x, &pt1.y,
|
||||
&pt1.z))
|
||||
{
|
||||
dwg_point_3d *pts = scan_pts3d (i1, &p);
|
||||
if (i1 && pts && sscanf (p, ") mtext %d", &i2))
|
||||
{
|
||||
dwg_add_LEADER (hdr, i1, pts, mtext, i2);
|
||||
}
|
||||
free (pts);
|
||||
}
|
||||
else if (SSCANF_S (p,
|
||||
"tolerance " FMT_TBL " (%lf %lf %lf) (%lf %lf %lf)",
|
||||
&text[0] SZ, &pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y,
|
||||
&pt2.z)) dwg_add_TOLERANCE (hdr, text, &pt1, &pt2);
|
||||
else if (SSCANF_S (p, "mlinestyle " FMT_TBL, &text[0] SZ)) mlinestyle
|
||||
= dwg_add_MLINESTYLE (dwg, text);
|
||||
else if (SSCANF_S (p, "dimstyle " FMT_TBL, &text[0] SZ)) dimstyle
|
||||
= dwg_add_DIMSTYLE (dwg, text);
|
||||
else SET_ENT (mlinestyle, MLINESTYLE);
|
||||
else SET_ENT (dimstyle, DIMSTYLE);
|
||||
else if (SSCANF_S (
|
||||
p, "ucs (%lf %lf %lf) (%lf %lf %lf) (%lf %lf %lf) " FMT_TBL,
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &pt3.x,
|
||||
&pt3.y, &pt3.z, &text[0] SZ)) ucs
|
||||
= dwg_add_UCS (dwg, &pt1, &pt2, &pt3, text);
|
||||
else SET_ENT (ucs, UCS);
|
||||
else if (viewport
|
||||
&& SSCANF_S (p, "layout viewport " FMT_TBL " " FMT_ANY,
|
||||
&text[0] SZ, &s1[0] SZ))
|
||||
{
|
||||
int error;
|
||||
Dwg_Object *obj = dwg_ent_generic_to_object (viewport, &error);
|
||||
if (!error)
|
||||
layout = dwg_add_LAYOUT (obj, text, s1);
|
||||
}
|
||||
else if (SSCANF_S (p, "torus (%lf %lf %lf) (%lf %lf %lf) %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &f1,
|
||||
&f2)) dwg_add_TORUS (hdr, &pt1, &pt2, f1, f2);
|
||||
else if (SSCANF_S (p, "sphere (%lf %lf %lf) (%lf %lf %lf) %lf", &pt1.x,
|
||||
&pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &f1))
|
||||
dwg_add_SPHERE (hdr, &pt1, &pt2, f1);
|
||||
else if (SSCANF_S (
|
||||
p, "cylinder (%lf %lf %lf) (%lf %lf %lf) %lf %lf %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &height,
|
||||
&f1, &f2, &len))
|
||||
dwg_add_CYLINDER (hdr, &pt1, &pt2, height, f1, f2, len);
|
||||
else if (SSCANF_S (p, "cone (%lf %lf %lf) (%lf %lf %lf) %lf %lf %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z,
|
||||
&height, &f1, &f2, &len))
|
||||
dwg_add_CONE (hdr, &pt1, &pt2, height, f1, f2, len);
|
||||
else if (SSCANF_S (p, "wedge (%lf %lf %lf) (%lf %lf %lf) %lf %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &len,
|
||||
&f1, &height))
|
||||
dwg_add_WEDGE (hdr, &pt1, &pt2, len, f1, height);
|
||||
else if (SSCANF_S (p, "box (%lf %lf %lf) (%lf %lf %lf) %lf %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z, &len,
|
||||
&f1, &height))
|
||||
dwg_add_BOX (hdr, &pt1, &pt2, len, f1, height);
|
||||
else if (SSCANF_S (p,
|
||||
"pyramid (%lf %lf %lf) (%lf %lf %lf) %lf %d %lf %lf",
|
||||
&pt1.x, &pt1.y, &pt1.z, &pt2.x, &pt2.y, &pt2.z,
|
||||
&height, &i1, &f1, &f2))
|
||||
dwg_add_PYRAMID (hdr, &pt1, &pt2, height, i1, f1, f2);
|
||||
else if (SSCANF_S (p, "HEADER." FMT_NAME " = %d", &s1[0] SZ, &i1))
|
||||
dwg_dynapi_header_set_value (dwg, s1, &i1, 0);
|
||||
else if (SSCANF_S (p, "HEADER." FMT_NAME " = %lf", &s1[0] SZ, &f1))
|
||||
dwg_dynapi_header_set_value (dwg, s1, &f1, 0);
|
||||
else if (SSCANF_S (p, "HEADER." FMT_NAME " = " FMT_ANY, &s1[0] SZ,
|
||||
&text[0] SZ))
|
||||
dwg_dynapi_header_set_value (dwg, s1, text, 1);
|
||||
|
||||
p = next_line (p, end);
|
||||
}
|
||||
// dwg_resolve_objectrefs_silent (orig_dwg);
|
||||
// start fuzzing if at least 2 entities were added.
|
||||
return (dwg->num_objects - orig_num > 2 ? 0 : 1);
|
||||
}
|
||||
|
||||
#endif // USE_WRITE
|
||||
BIN
astral-service/static/lib/libredwg/examples/dwgfuzz.exe
Normal file
BIN
astral-service/static/lib/libredwg/examples/dwgfuzz.exe
Normal file
Binary file not shown.
335
astral-service/static/lib/libredwg/examples/llvmfuzz.c
Normal file
335
astral-service/static/lib/libredwg/examples/llvmfuzz.c
Normal file
@@ -0,0 +1,335 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2021, 2023 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* llvmfuzz.c: libfuzzer testing, esp. for oss-fuzz. with libfuzzer or
|
||||
* standalone written by Reini Urban
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
//#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "common.h"
|
||||
#include <dwg.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include "decode.h"
|
||||
#include "encode.h"
|
||||
#include "bits.h"
|
||||
#ifndef DISABLE_DXF
|
||||
# include "out_dxf.h"
|
||||
# ifndef DISABLE_JSON
|
||||
# include "in_json.h"
|
||||
# include "out_json.h"
|
||||
# endif
|
||||
# include "in_dxf.h"
|
||||
#endif
|
||||
|
||||
int out;
|
||||
int ver;
|
||||
|
||||
extern int LLVMFuzzerTestOneInput (const unsigned char *data, size_t size);
|
||||
|
||||
// libfuzzer limitation:
|
||||
// Enforce NULL-termination of the input buffer, to avoid bogus reports. copy
|
||||
// it. Problematic is mostly strtol(3) which also works with \n termination.
|
||||
static int
|
||||
enforce_null_termination (Bit_Chain *dat, bool enforce)
|
||||
{
|
||||
unsigned char *copy;
|
||||
unsigned char c;
|
||||
if (!dat->size)
|
||||
return 0;
|
||||
c = dat->chain[dat->size - 1];
|
||||
// Allow \n termination without \0 in DXF? No, still crashes
|
||||
if (!enforce && ((c == '\n' && c + 1 == '\0') || c == '\0'))
|
||||
return 0;
|
||||
#ifdef STANDALONE
|
||||
fprintf (stderr,
|
||||
"llvmfuzz_standalone: enforce libfuzzer buffer NULL termination\n");
|
||||
#endif
|
||||
copy = malloc (dat->size + 1);
|
||||
memcpy (copy, dat->chain, dat->size);
|
||||
copy[dat->size] = '\0';
|
||||
dat->chain = copy;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LLVMFuzzerTestOneInput (const unsigned char *data, size_t size)
|
||||
{
|
||||
Dwg_Data dwg;
|
||||
Bit_Chain dat = { NULL, 0, 0, 0, 0, 0, 0, NULL, 0 };
|
||||
Bit_Chain out_dat = { NULL, 0, 0, 0, 0, 0, 0, NULL, 0 };
|
||||
int copied = 0;
|
||||
struct ly_ctx *ctx = NULL;
|
||||
|
||||
static char tmp_file[256];
|
||||
dat.chain = (unsigned char *)data;
|
||||
dat.size = size;
|
||||
memset (&dwg, 0, sizeof (dwg));
|
||||
|
||||
// Detect the input format: DWG, DXF or JSON
|
||||
if (dat.size > 2 && dat.chain[0] == 'A' && dat.chain[1] == 'C')
|
||||
{
|
||||
if (dwg_decode (&dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
{
|
||||
dwg_free (&dwg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#ifndef DISABLE_JSON
|
||||
else if (dat.size > 1 && dat.chain[0] == '{')
|
||||
{
|
||||
copied = enforce_null_termination (&dat, true);
|
||||
if (dwg_read_json (&dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (copied)
|
||||
bit_chain_free (&dat);
|
||||
dwg_free (&dwg);
|
||||
return 0;
|
||||
}
|
||||
dat.opts |= DWG_OPTS_INJSON;
|
||||
dwg.opts |= DWG_OPTS_INJSON;
|
||||
}
|
||||
#endif
|
||||
#ifndef DISABLE_DXF
|
||||
else
|
||||
{
|
||||
copied = enforce_null_termination (&dat, false);
|
||||
if (dwg_read_dxf (&dat, &dwg) >= DWG_ERR_CRITICAL)
|
||||
{
|
||||
if (copied)
|
||||
bit_chain_free (&dat);
|
||||
dwg_free (&dwg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
memset (&out_dat, 0, sizeof (out_dat));
|
||||
bit_chain_set_version (&out_dat, &dat);
|
||||
if (copied)
|
||||
bit_chain_free (&dat);
|
||||
|
||||
#if 0
|
||||
snprintf (tmp_file, 255, "/tmp/llvmfuzzer%d.out", getpid());
|
||||
tmp_file[255] = '\0';
|
||||
#elif defined _WIN32
|
||||
strcpy (tmp_file, "NUL");
|
||||
#else
|
||||
strcpy (tmp_file, "/dev/null");
|
||||
#endif
|
||||
out_dat.fh = fopen (tmp_file, "w");
|
||||
|
||||
switch (out)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
switch (ver)
|
||||
{
|
||||
// TODO support preR13, many downconverters still missing
|
||||
case 0:
|
||||
out_dat.version = dwg.header.version = R_1_4;
|
||||
break;
|
||||
case 1:
|
||||
out_dat.version = dwg.header.version = R_2_0;
|
||||
break;
|
||||
case 2:
|
||||
out_dat.version = dwg.header.version = R_2_10;
|
||||
break;
|
||||
case 3:
|
||||
out_dat.version = dwg.header.version = R_2_21;
|
||||
break;
|
||||
case 4:
|
||||
out_dat.version = dwg.header.version = R_2_4;
|
||||
break;
|
||||
case 5:
|
||||
out_dat.version = dwg.header.version = R_2_6;
|
||||
break;
|
||||
case 6:
|
||||
out_dat.version = dwg.header.version = R_9;
|
||||
break;
|
||||
case 7:
|
||||
out_dat.version = dwg.header.version = R_10;
|
||||
break;
|
||||
case 8:
|
||||
out_dat.version = dwg.header.version = R_11;
|
||||
break;
|
||||
case 9:
|
||||
out_dat.version = dwg.header.version = R_12;
|
||||
break;
|
||||
case 10:
|
||||
out_dat.version = dwg.header.version = R_13;
|
||||
break;
|
||||
case 11:
|
||||
out_dat.version = dwg.header.version = R_13c3;
|
||||
break;
|
||||
case 12:
|
||||
out_dat.version = dwg.header.version = R_14;
|
||||
break;
|
||||
case 13:
|
||||
out_dat.version = dwg.header.version = R_2004;
|
||||
break;
|
||||
default: // favor this one
|
||||
out_dat.version = dwg.header.version = R_2000;
|
||||
break;
|
||||
}
|
||||
dwg_encode (&dwg, &out_dat);
|
||||
break;
|
||||
}
|
||||
#ifndef DISABLE_DXF
|
||||
case 1:
|
||||
dwg_write_dxf (&out_dat, &dwg);
|
||||
break;
|
||||
case 2: // experimental
|
||||
dwg_write_dxfb (&out_dat, &dwg);
|
||||
break;
|
||||
# ifndef DISABLE_JSON
|
||||
case 3:
|
||||
dwg_write_json (&out_dat, &dwg);
|
||||
break;
|
||||
case 4:
|
||||
dwg_write_geojson (&out_dat, &dwg);
|
||||
break;
|
||||
# endif
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dwg_free (&dwg);
|
||||
free (out_dat.chain);
|
||||
fclose (out_dat.fh);
|
||||
// unlink (tmp_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef STANDALONE
|
||||
/*
|
||||
# ifdef __GNUC__
|
||||
__attribute__((weak))
|
||||
# endif
|
||||
extern int LLVMFuzzerInitialize(int *argc, char ***argv);
|
||||
*/
|
||||
|
||||
static int
|
||||
usage (void)
|
||||
{
|
||||
printf ("\nUsage: OUT=0 VER=3 llvmfuzz_standalone INPUT...");
|
||||
return 1;
|
||||
}
|
||||
// llvmfuzz_standalone reproducer, see OUT and VER env vars
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
unsigned seed;
|
||||
const unsigned int possible_outputformats =
|
||||
#ifdef DISABLE_DXF
|
||||
# ifdef DISABLE_JSON
|
||||
1;
|
||||
# else
|
||||
3;
|
||||
# endif
|
||||
#else
|
||||
5;
|
||||
#endif
|
||||
|
||||
if (argc <= 1 || !*argv[1])
|
||||
return usage ();
|
||||
if (getenv ("SEED"))
|
||||
seed = (unsigned)strtol (getenv ("SEED"), NULL, 10) % 9999;
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
struct timeval tval;
|
||||
gettimeofday (&tval, NULL);
|
||||
seed = (unsigned)(tval.tv_sec * 1000 + tval.tv_usec) % 9999;
|
||||
#else
|
||||
seed = (unsigned)time (NULL) % 9999;
|
||||
#endif
|
||||
}
|
||||
srand (seed);
|
||||
/* works only on linux
|
||||
if (LLVMFuzzerInitialize)
|
||||
LLVMFuzzerInitialize (&argc, &argv);
|
||||
*/
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
unsigned char *buf;
|
||||
FILE *f = fopen (argv[i], "rb");
|
||||
struct stat attrib;
|
||||
long len;
|
||||
size_t n_read;
|
||||
int fd;
|
||||
if (!f)
|
||||
{
|
||||
fprintf (stderr, "Illegal file argument %s\n", argv[i]);
|
||||
continue;
|
||||
}
|
||||
fd = fileno (f);
|
||||
if (fd < 0 || fstat (fd, &attrib)
|
||||
|| !(S_ISREG (attrib.st_mode)
|
||||
# ifndef _WIN32
|
||||
|| S_ISLNK (attrib.st_mode)
|
||||
# endif
|
||||
))
|
||||
{
|
||||
fprintf (stderr, "Illegal input file \"%s\"\n", argv[i]);
|
||||
continue;
|
||||
}
|
||||
// libFuzzer design bug, not zero-terminating its text buffer
|
||||
fseek (f, 0, SEEK_END);
|
||||
len = ftell (f);
|
||||
fseek (f, 0, SEEK_SET);
|
||||
if (len <= 0)
|
||||
continue;
|
||||
buf = (unsigned char *)malloc (len);
|
||||
n_read = fread (buf, 1, len, f);
|
||||
fclose (f);
|
||||
assert ((long)n_read == len);
|
||||
|
||||
out = rand () % possible_outputformats;
|
||||
#ifdef STANDALONE
|
||||
if (getenv ("OUT"))
|
||||
out = strtol (getenv ("OUT"), NULL, 10);
|
||||
// print SEED onlyu when needed (no env vars given)
|
||||
if (!(out || getenv ("VER")))
|
||||
fprintf (stderr, "SEED=%04u ", seed);
|
||||
fprintf (stderr, "OUT=%d ", out);
|
||||
#endif
|
||||
if (out == 0)
|
||||
{
|
||||
ver = rand () % 20;
|
||||
#ifdef STANDALONE
|
||||
if (getenv ("VER"))
|
||||
ver = strtol (getenv ("VER"), NULL, 10);
|
||||
fprintf (stderr, "VER=%d ", ver);
|
||||
#endif
|
||||
}
|
||||
fprintf (stderr, "examples/llvmfuzz_standalone %s [%" PRIuSIZE "]\n",
|
||||
argv[i], len);
|
||||
LLVMFuzzerTestOneInput (buf, len);
|
||||
free (buf);
|
||||
// Bit_Chain dat = { 0 };
|
||||
// dat_read_file (&dat, fp, argv[i]);
|
||||
// LLVMFuzzerTestOneInput (dat.chain, dat.size);
|
||||
// bit_free_chain (&dat);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
230
astral-service/static/lib/libredwg/examples/load_dwg.c
Normal file
230
astral-service/static/lib/libredwg/examples/load_dwg.c
Normal file
@@ -0,0 +1,230 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2009, 2023 Free Software Foundation, Inc. */
|
||||
/* Copyright (C) 2010 Thien-Thi Nguyen */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* load_dwg.c: load a DWG, get lines, text and circles
|
||||
* written by Felipe Castro
|
||||
* modified by Felipe Corrêa da Silva Sances
|
||||
* modified by Thien-Thi Nguyen
|
||||
* modified by Reini Urban
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef __STDC_ALLOC_LIB__ /* for strdup */
|
||||
# define __STDC_WANT_LIB_EXT2__ 1 /* for strdup */
|
||||
#else
|
||||
# define _USE_BSD 1
|
||||
#endif
|
||||
#ifndef _XOPEN_SOURCE /* for strdup, snprintf */
|
||||
# define _XOPEN_SOURCE 700
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#ifndef DISABLE_WRITE
|
||||
# include <sys/stat.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include "dwg.h"
|
||||
#include "dwg_api.h"
|
||||
#include "../src/bits.h"
|
||||
|
||||
#include "../programs/suffix.inc"
|
||||
static int help (void);
|
||||
int verbosity (int argc, char **argv, int i, unsigned int *opts);
|
||||
#include "../programs/common.inc"
|
||||
|
||||
static int
|
||||
usage (void)
|
||||
{
|
||||
printf ("\nUsage: load_dwg [-v[0-9]] DWGFILE\n");
|
||||
return 1;
|
||||
}
|
||||
static int
|
||||
opt_version (void)
|
||||
{
|
||||
printf ("load_dwg %s\n", PACKAGE_VERSION);
|
||||
return 0;
|
||||
}
|
||||
static int
|
||||
help (void)
|
||||
{
|
||||
printf ("\nUsage: load_dwg [OPTION]... DWGFILE\n");
|
||||
printf ("Example to add fingerprint elements to a DWG.\n"
|
||||
"\n");
|
||||
printf (" -v[0-9], --verbose [0-9] verbosity\n");
|
||||
printf (" --help display this help and exit\n");
|
||||
printf (" --version output version information and exit\n"
|
||||
"\n");
|
||||
printf ("GNU LibreDWG online manual: "
|
||||
"<https://www.gnu.org/software/libredwg/>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
add_fingerprint (Dwg_Data *dwg, dwg_point_3d *pt)
|
||||
{
|
||||
int error = 0;
|
||||
char text[128];
|
||||
double height = dwg->header_vars.TEXTSIZE;
|
||||
time_t t = time (NULL);
|
||||
Dwg_Object_BLOCK_HEADER *hdr = dwg_get_block_header (dwg, &error);
|
||||
Dwg_Entity_TEXT *ent;
|
||||
if (error)
|
||||
return 1;
|
||||
|
||||
#ifdef HAVE_WFORMAT_Y2K
|
||||
GCC46_DIAG_IGNORE (-Wformat-y2k)
|
||||
#endif
|
||||
strftime (text, sizeof (text), "Last updated: %c", localtime (&t));
|
||||
#ifdef HAVE_WFORMAT_Y2K
|
||||
GCC46_DIAG_RESTORE
|
||||
#endif
|
||||
|
||||
#ifdef USE_WRITE
|
||||
if ((ent = dwg_add_TEXT (hdr, text, pt, height)))
|
||||
{
|
||||
ent->horiz_alignment = HORIZ_ALIGNMENT_RIGHT;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
change_fingerprint (Dwg_Data *dwg, Dwg_Entity_TEXT *_obj)
|
||||
{
|
||||
char text[128];
|
||||
double height = dwg->header_vars.TEXTSIZE;
|
||||
time_t t = time (NULL);
|
||||
|
||||
#ifdef HAVE_WFORMAT_Y2K
|
||||
GCC46_DIAG_IGNORE (-Wformat-y2k)
|
||||
#endif
|
||||
strftime (text, sizeof (text), "Last updated: %c", localtime (&t));
|
||||
#ifdef HAVE_WFORMAT_Y2K
|
||||
GCC46_DIAG_RESTORE
|
||||
#endif
|
||||
|
||||
if (dwg->header.version < R_2007)
|
||||
{
|
||||
if (strlen (text) < strlen (_obj->text_value))
|
||||
strcpy (_obj->text_value, text);
|
||||
else
|
||||
{
|
||||
free (_obj->text_value);
|
||||
_obj->text_value = strdup (text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
free (_obj->text_value);
|
||||
_obj->text_value = (BITCODE_TV)bit_utf8_to_TU (text, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
load_dwg (char *filename, unsigned int opts)
|
||||
{
|
||||
BITCODE_BL i;
|
||||
int success, found = 0;
|
||||
Dwg_Data dwg;
|
||||
dwg_point_3d pt;
|
||||
|
||||
#ifdef USE_WRITE
|
||||
char *new_filename = (char *)malloc (strlen (filename) + 4);
|
||||
char *fn = strdup (filename);
|
||||
char *base = basename (fn);
|
||||
char *p;
|
||||
struct stat st;
|
||||
|
||||
if ((p = strrchr (base, '.')))
|
||||
*p = '\0';
|
||||
sprintf (new_filename, "%s_new.dwg", base);
|
||||
free (fn);
|
||||
#endif
|
||||
|
||||
memset (&dwg, 0, sizeof (Dwg_Data));
|
||||
dwg.opts = opts;
|
||||
success = dwg_read_file (filename, &dwg);
|
||||
// get the insertion point for our fingerprint
|
||||
pt.x = dwg.header_vars.LIMMAX.x;
|
||||
pt.y = dwg.header_vars.LIMMAX.y;
|
||||
pt.z = 0.0;
|
||||
|
||||
// check if a fingerprint already exists there.
|
||||
// if so update it. if not add it
|
||||
for (i = 0; i < dwg.num_objects; i++)
|
||||
{
|
||||
if (dwg.object[i].fixedtype == DWG_TYPE_TEXT)
|
||||
{
|
||||
Dwg_Entity_TEXT *_obj = dwg.object[i].tio.entity->tio.TEXT;
|
||||
if (pt.x == _obj->ins_pt.x && pt.y == _obj->ins_pt.y
|
||||
&& _obj->horiz_alignment == HORIZ_ALIGNMENT_RIGHT)
|
||||
{
|
||||
found++;
|
||||
change_fingerprint (&dwg, _obj);
|
||||
fprintf (stderr, "fingerprint updated at (%f, %f)\n", pt.x,
|
||||
pt.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
add_fingerprint (&dwg, &pt);
|
||||
fprintf (stderr, "fingerprint added at (%f, %f)\n", pt.x, pt.y);
|
||||
}
|
||||
|
||||
#ifdef USE_WRITE
|
||||
if (0 == stat (new_filename, &st))
|
||||
unlink (new_filename);
|
||||
if (dwg.header.version > R_2000)
|
||||
dwg.header.version = R_2000;
|
||||
success = dwg_write_file (new_filename, &dwg);
|
||||
free (new_filename);
|
||||
#endif
|
||||
|
||||
dwg_free (&dwg);
|
||||
return success;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int i = 1;
|
||||
unsigned int opts = 0;
|
||||
|
||||
if (argc < 2)
|
||||
return usage ();
|
||||
#if defined(USE_TRACING) && defined(HAVE_SETENV)
|
||||
setenv ("LIBREDWG_TRACE", "1", 0);
|
||||
#endif
|
||||
if (argc > 2
|
||||
&& (!strcmp (argv[i], "--verbose") || !strncmp (argv[i], "-v", 2)))
|
||||
{
|
||||
int num_args = verbosity (argc, argv, i, &opts);
|
||||
argc -= num_args;
|
||||
i += num_args;
|
||||
}
|
||||
if (argc > 1 && !strcmp (argv[i], "--help"))
|
||||
return help ();
|
||||
if (argc > 1 && !strcmp (argv[i], "--version"))
|
||||
return opt_version ();
|
||||
|
||||
REQUIRE_INPUT_FILE_ARG (argc);
|
||||
load_dwg (argv[i], opts);
|
||||
return 0;
|
||||
}
|
||||
BIN
astral-service/static/lib/libredwg/examples/load_dwg.exe
Normal file
BIN
astral-service/static/lib/libredwg/examples/load_dwg.exe
Normal file
Binary file not shown.
76
astral-service/static/lib/libredwg/examples/odaversion.c
Normal file
76
astral-service/static/lib/libredwg/examples/odaversion.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/*****************************************************************************/
|
||||
/* LibreDWG - free implementation of the DWG file format */
|
||||
/* */
|
||||
/* Copyright (C) 2023 Free Software Foundation, Inc. */
|
||||
/* */
|
||||
/* This library is free software, licensed under the terms of the GNU */
|
||||
/* General Public License as published by the Free Software Foundation, */
|
||||
/* either version 3 of the License, or (at your option) any later version. */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* odaversion.c: prints the ODA compatible DWG version
|
||||
* modified by Reini Urban
|
||||
oda understands those versions:
|
||||
"ACAD9","ACAD10","ACAD12",
|
||||
"ACAD13","ACAD14",
|
||||
"ACAD2000","ACAD2004",
|
||||
"ACAD2007","ACAD2010",
|
||||
"ACAD2013","ACAD2018"
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
FILE *f;
|
||||
char buf[7];
|
||||
size_t size;
|
||||
|
||||
if (argc != 2)
|
||||
return 1;
|
||||
f = fopen (argv[1], "rb");
|
||||
if (!f)
|
||||
return 1;
|
||||
size = fread (buf, 1, 6, f);
|
||||
if (size != 6)
|
||||
return 1;
|
||||
buf[6] = '\0';
|
||||
if (buf[0] == 'A' && buf[1] == 'C')
|
||||
{
|
||||
int v;
|
||||
if (1 != sscanf (buf, "AC%4d", &v))
|
||||
return 1;
|
||||
if (v < 1004) // <r9
|
||||
printf ("\n");
|
||||
else if (v <= 1005)
|
||||
printf ("9\n");
|
||||
else if (v <= 1006)
|
||||
printf ("10\n");
|
||||
else if (v <= 1009)
|
||||
printf ("11\n");
|
||||
else if (v <= 1012)
|
||||
printf ("13\n");
|
||||
else if (v <= 1014)
|
||||
printf ("14\n");
|
||||
else if (v <= 1016)
|
||||
printf ("2000\n");
|
||||
else if (v <= 1018)
|
||||
printf ("2004\n");
|
||||
else if (v <= 1021)
|
||||
printf ("2007\n");
|
||||
else if (v <= 1024)
|
||||
printf ("2010\n");
|
||||
else if (v < 1028)
|
||||
printf ("2013\n");
|
||||
else if (v < 1033)
|
||||
printf ("2018\n");
|
||||
else
|
||||
printf ("\n");
|
||||
}
|
||||
fclose (f);
|
||||
return 0;
|
||||
}
|
||||
15
astral-service/static/lib/libredwg/examples/rsdecode.c
Normal file
15
astral-service/static/lib/libredwg/examples/rsdecode.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
unsigned char block[255];
|
||||
|
||||
main ()
|
||||
{
|
||||
int len, err;
|
||||
while (!feof (stdin))
|
||||
{
|
||||
len = fread (block, 1, 255, stdin);
|
||||
err = rs_decode_block (block, 1);
|
||||
fwrite (block, 1, 239, stdout);
|
||||
}
|
||||
}
|
||||
28
astral-service/static/lib/libredwg/examples/rsencode.c
Normal file
28
astral-service/static/lib/libredwg/examples/rsencode.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
unsigned char data[239];
|
||||
unsigned char parity[16];
|
||||
|
||||
main ()
|
||||
{
|
||||
int len, i;
|
||||
while (!feof (stdin))
|
||||
{
|
||||
len = fread (data, 1, 239, stdin);
|
||||
rs_encode_block (parity, data, len);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
fputc ('-', stderr);
|
||||
}
|
||||
|
||||
fwrite (data, 1, len, stdout);
|
||||
|
||||
while (len++ < 239)
|
||||
fputc (0, stdout); /* Pad data with 0s */
|
||||
|
||||
fwrite (parity, 16, 1, stdout);
|
||||
}
|
||||
}
|
||||
1600
astral-service/static/lib/libredwg/examples/unknown.c
Normal file
1600
astral-service/static/lib/libredwg/examples/unknown.c
Normal file
File diff suppressed because it is too large
Load Diff
10343
astral-service/static/lib/libredwg/include/dwg.h
Normal file
10343
astral-service/static/lib/libredwg/include/dwg.h
Normal file
File diff suppressed because it is too large
Load Diff
7311
astral-service/static/lib/libredwg/include/dwg_api.h
Normal file
7311
astral-service/static/lib/libredwg/include/dwg_api.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
astral-service/static/lib/libredwg/lib/libredwg.dll.a
Normal file
BIN
astral-service/static/lib/libredwg/lib/libredwg.dll.a
Normal file
Binary file not shown.
41
astral-service/static/lib/libredwg/lib/libredwg.la
Normal file
41
astral-service/static/lib/libredwg/lib/libredwg.la
Normal file
@@ -0,0 +1,41 @@
|
||||
# libredwg.la - a libtool library file
|
||||
# Generated by libtool (GNU libtool) 2.4.7
|
||||
#
|
||||
# Please DO NOT delete this file!
|
||||
# It is necessary for linking the library.
|
||||
|
||||
# The name that we can dlopen(3).
|
||||
dlname='../bin/libredwg-0.dll'
|
||||
|
||||
# Names of this library.
|
||||
library_names='libredwg.dll.a'
|
||||
|
||||
# The name of the static archive.
|
||||
old_library=''
|
||||
|
||||
# Linker flags that cannot go in dependency_libs.
|
||||
inherited_linker_flags=''
|
||||
|
||||
# Libraries that this one depends upon.
|
||||
dependency_libs=''
|
||||
|
||||
# Names of additional weak libraries provided by this library
|
||||
weak_library_names=''
|
||||
|
||||
# Version information for libredwg.
|
||||
current=0
|
||||
age=0
|
||||
revision=13
|
||||
|
||||
# Is this an already installed library?
|
||||
installed=yes
|
||||
|
||||
# Should we warn about portability when linking against -modules?
|
||||
shouldnotlink=no
|
||||
|
||||
# Files to dlopen/dlpreopen
|
||||
dlopen=''
|
||||
dlpreopen=''
|
||||
|
||||
# Directory that this library needs to be installed in:
|
||||
libdir='/lib'
|
||||
12
astral-service/static/lib/libredwg/lib/pkgconfig/libredwg.pc
Normal file
12
astral-service/static/lib/libredwg/lib/pkgconfig/libredwg.pc
Normal file
@@ -0,0 +1,12 @@
|
||||
# libredwg.pc. Generated from libredwg.pc.in by configure.
|
||||
prefix=
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: libredwg
|
||||
Description: Free implementation of the DWG file format
|
||||
Version: 20c18f6f
|
||||
URL: https://savannah.gnu.org/projects/libredwg/
|
||||
Libs: -L${libdir} -lredwg -lm
|
||||
Cflags: -I${includedir}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
# _LibreDWG.la - a libtool library file
|
||||
# Generated by libtool (GNU libtool) 2.4.7
|
||||
#
|
||||
# Please DO NOT delete this file!
|
||||
# It is necessary for linking the library.
|
||||
|
||||
# The name that we can dlopen(3).
|
||||
dlname='_LibreDWG-0.dll'
|
||||
|
||||
# Names of this library.
|
||||
library_names='_LibreDWG.dll.a'
|
||||
|
||||
# The name of the static archive.
|
||||
old_library=''
|
||||
|
||||
# Linker flags that cannot go in dependency_libs.
|
||||
inherited_linker_flags=''
|
||||
|
||||
# Libraries that this one depends upon.
|
||||
dependency_libs=' /lib/libredwg.la -L=C:/msys64/MINGW64/lib -lpython3.11 -lversion -lshlwapi -lpathcch -lbcrypt'
|
||||
|
||||
# Names of additional weak libraries provided by this library
|
||||
weak_library_names=''
|
||||
|
||||
# Version information for _LibreDWG.
|
||||
current=0
|
||||
age=0
|
||||
revision=0
|
||||
|
||||
# Is this an already installed library?
|
||||
installed=yes
|
||||
|
||||
# Should we warn about portability when linking against -modules?
|
||||
shouldnotlink=yes
|
||||
|
||||
# Files to dlopen/dlpreopen
|
||||
dlopen=''
|
||||
dlpreopen=''
|
||||
|
||||
# Directory that this library needs to be installed in:
|
||||
libdir='/lib/python3.11/site-packages'
|
||||
BIN
astral-service/static/lib/libredwg/libiconv-2.dll
Normal file
BIN
astral-service/static/lib/libredwg/libiconv-2.dll
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/libpcre2-16-0.dll
Normal file
BIN
astral-service/static/lib/libredwg/libpcre2-16-0.dll
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/libpcre2-8-0.dll
Normal file
BIN
astral-service/static/lib/libredwg/libpcre2-8-0.dll
Normal file
Binary file not shown.
BIN
astral-service/static/lib/libredwg/libredwg-0.dll
Normal file
BIN
astral-service/static/lib/libredwg/libredwg-0.dll
Normal file
Binary file not shown.
560
astral-service/static/lib/libredwg/share/info/LibreDWG.info
Normal file
560
astral-service/static/lib/libredwg/share/info/LibreDWG.info
Normal file
@@ -0,0 +1,560 @@
|
||||
This is LibreDWG.info, produced by makeinfo version 7.1 from
|
||||
LibreDWG.texi.
|
||||
|
||||
This manual is for GNU LibreDWG (version 20c18f6f, 26 March 2024).
|
||||
|
||||
Copyright © 2010-2024 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
Version 1.3 or any later version published by the Free Software
|
||||
Foundation; with no Invariant Sections, with no Front-Cover Texts,
|
||||
and with no Back-Cover Texts. A copy of the license is included in
|
||||
the section entitled "GNU Free Documentation License".
|
||||
|
||||
All other trademarks, trade names or company names referenced herein
|
||||
are used for identification purposes only and are the property of their
|
||||
respective owners.
|
||||
|
||||
DWG is the native and proprietary file format for AutoCAD® and a
|
||||
trademark of Autodesk, Inc. LibreDWG is neither associated with
|
||||
Autodesk, nor with the Open Design Alliance.
|
||||
INFO-DIR-SECTION Libraries
|
||||
START-INFO-DIR-ENTRY
|
||||
* LibreDWG: (LibreDWG). Free implementation of the DWG file format.
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
|
||||
Indirect:
|
||||
LibreDWG.info-1: 1100
|
||||
LibreDWG.info-2: 301358
|
||||
|
||||
Tag Table:
|
||||
(Indirect)
|
||||
Node: Top1100
|
||||
Node: Overview2731
|
||||
Node: Usage10928
|
||||
Node: Types11659
|
||||
Node: Objects14385
|
||||
Node: HEADER14676
|
||||
Node: ENTITIES30731
|
||||
Ref: 3DFACE30924
|
||||
Ref: 3DLINE31270
|
||||
Ref: 3DSOLID31502
|
||||
Ref: ALIGNMENTPARAMETERENTITY32847
|
||||
Ref: ARC32913
|
||||
Ref: ARCALIGNEDTEXT33240
|
||||
Ref: ARC_DIMENSION34475
|
||||
Ref: ATTDEF35860
|
||||
Ref: ATTRIB37112
|
||||
Ref: BASEPOINTPARAMETERENTITY38297
|
||||
Ref: BLOCK38365
|
||||
Ref: BODY38551
|
||||
Ref: CAMERA38586
|
||||
Ref: CIRCLE38683
|
||||
Ref: DGNUNDERLAY38921
|
||||
Ref: UNDERLAY38921
|
||||
Ref: DIMENSION_ALIGNED39508
|
||||
Ref: DIMENSION_ANG2LN40640
|
||||
Ref: DIMENSION_ANG3PT41828
|
||||
Ref: DIMENSION_DIAMETER42997
|
||||
Ref: DIMENSION_LINEAR44086
|
||||
Ref: DIMENSION_ORDINATE45265
|
||||
Ref: DIMENSION_RADIUS46394
|
||||
Ref: DWFUNDERLAY47478
|
||||
Ref: ELLIPSE47515
|
||||
Ref: ENDBLK47837
|
||||
Ref: ENDREP47906
|
||||
Ref: EXTRUDEDSURFACE48150
|
||||
Ref: FLIPGRIPENTITY50754
|
||||
Ref: FLIPPARAMETERENTITY50836
|
||||
Ref: GEOPOSITIONMARKER50916
|
||||
Ref: HATCH51382
|
||||
Ref: HELIX52635
|
||||
Ref: IMAGE53932
|
||||
Ref: INSERT54683
|
||||
Ref: JUMP55419
|
||||
Ref: LARGE_RADIAL_DIMENSION55643
|
||||
Ref: LAYOUTPRINTCONFIG56820
|
||||
Ref: LEADER56964
|
||||
Ref: LIGHT58114
|
||||
Ref: LINE60244
|
||||
Ref: LINEARGRIPENTITY60555
|
||||
Ref: LINEARPARAMETERENTITY60639
|
||||
Ref: LOAD60706
|
||||
Ref: LOFTEDSURFACE60823
|
||||
Ref: LWPOLYLINE63201
|
||||
Ref: MESH63801
|
||||
Ref: MINSERT64462
|
||||
Ref: MLINE65157
|
||||
Ref: MPOLYGON65609
|
||||
Ref: MTEXT66767
|
||||
Ref: MULTILEADER68217
|
||||
Ref: NAVISWORKSMODEL70065
|
||||
Ref: NURBSURFACE70308
|
||||
Ref: OLE2FRAME71970
|
||||
Ref: OLEFRAME72397
|
||||
Ref: PDFUNDERLAY72617
|
||||
Ref: PLANESURFACE72659
|
||||
Ref: POINT74164
|
||||
Ref: POINTCLOUD74462
|
||||
Ref: POINTCLOUDEX75482
|
||||
Ref: POINTPARAMETERENTITY77015
|
||||
Ref: POLARGRIPENTITY77093
|
||||
Ref: POLYLINE_2D77167
|
||||
Ref: POLYLINE_3D77900
|
||||
Ref: POLYLINE_MESH78393
|
||||
Ref: POLYLINE_PFACE78930
|
||||
Ref: PROXY_ENTITY79332
|
||||
Ref: RAY79758
|
||||
Ref: REGION79906
|
||||
Ref: REPEAT79941
|
||||
Ref: REVOLVEDSURFACE80019
|
||||
Ref: ROTATIONGRIPENTITY82096
|
||||
Ref: ROTATIONPARAMETERENTITY82182
|
||||
Ref: RTEXT82250
|
||||
Ref: SECTIONOBJECT82600
|
||||
Ref: SEQEND83225
|
||||
Ref: SHAPE83332
|
||||
Ref: SOLID83771
|
||||
Ref: SPLINE84131
|
||||
Ref: SWEPTSURFACE84989
|
||||
Ref: TABLE87707
|
||||
Ref: TEXT93983
|
||||
Ref: TOLERANCE94696
|
||||
Ref: TRACE95063
|
||||
Ref: UNKNOWN_ENT95428
|
||||
Ref: VERTEX_2D95500
|
||||
Ref: VERTEX_3D95851
|
||||
Ref: VERTEX_MESH96001
|
||||
Ref: VERTEX_PFACE96044
|
||||
Ref: VERTEX_PFACE_FACE96092
|
||||
Ref: VIEWPORT96240
|
||||
Ref: VISIBILITYGRIPENTITY98255
|
||||
Ref: VISIBILITYPARAMETERENTITY98343
|
||||
Ref: WIPEOUT98413
|
||||
Ref: XLINE99163
|
||||
Ref: XYGRIPENTITY99200
|
||||
Ref: XYPARAMETERENTITY99280
|
||||
Node: OBJECTS99338
|
||||
Ref: ACMECOMMANDHISTORY99530
|
||||
Ref: ACMESCOPE99640
|
||||
Ref: ACMESTATEMGR99753
|
||||
Ref: ACSH_BOOLEAN_CLASS99872
|
||||
Ref: ACSH_BOX_CLASS100249
|
||||
Ref: ACSH_BREP_CLASS100617
|
||||
Ref: ACSH_CHAMFER_CLASS102130
|
||||
Ref: ACSH_CONE_CLASS102622
|
||||
Ref: ACSH_CYLINDER_CLASS103048
|
||||
Ref: ACSH_EXTRUSION_CLASS103475
|
||||
Ref: ACSH_FILLET_CLASS104805
|
||||
Ref: ACSH_HISTORY_CLASS105455
|
||||
Ref: ACSH_LOFT_CLASS105780
|
||||
Ref: ACSH_PYRAMID_CLASS106191
|
||||
Ref: ACSH_REVOLVE_CLASS106604
|
||||
Ref: ACSH_SPHERE_CLASS107316
|
||||
Ref: ACSH_SWEEP_CLASS107608
|
||||
Ref: ACSH_TORUS_CLASS108937
|
||||
Ref: ACSH_WEDGE_CLASS109280
|
||||
Ref: ALDIMOBJECTCONTEXTDATA109655
|
||||
Ref: ANGDIMOBJECTCONTEXTDATA109961
|
||||
Ref: ANNOTSCALEOBJECTCONTEXTDATA110267
|
||||
Ref: APPID110462
|
||||
Ref: APPID_CONTROL110834
|
||||
Ref: ASSOC2DCONSTRAINTGROUP111074
|
||||
Ref: ASSOC3POINTANGULARDIMACTIONBODY112017
|
||||
Ref: ASSOCACTION112485
|
||||
Ref: ASSOCACTIONPARAM113090
|
||||
Ref: ASSOCALIGNEDDIMACTIONBODY113298
|
||||
Ref: ASSOCARRAYACTIONBODY113734
|
||||
Ref: ASSOCARRAYMODIFYACTIONBODY114053
|
||||
Ref: ASSOCASMBODYACTIONPARAM114499
|
||||
Ref: ASSOCBLENDSURFACEACTIONBODY116061
|
||||
Ref: ASSOCCOMPOUNDACTIONPARAM116647
|
||||
Ref: ASSOCDEPENDENCY117293
|
||||
Ref: ASSOCDIMDEPENDENCYBODY117984
|
||||
Ref: ASSOCEDGEACTIONPARAM118240
|
||||
Ref: ASSOCEDGECHAMFERACTIONBODY118738
|
||||
Ref: ASSOCEDGEFILLETACTIONBODY119022
|
||||
Ref: ASSOCEXTENDSURFACEACTIONBODY119309
|
||||
Ref: ASSOCEXTRUDEDSURFACEACTIONBODY119684
|
||||
Ref: ASSOCFACEACTIONPARAM120009
|
||||
Ref: ASSOCFILLETSURFACEACTIONBODY120392
|
||||
Ref: ASSOCGEOMDEPENDENCY120829
|
||||
Ref: ASSOCLOFTEDSURFACEACTIONBODY121164
|
||||
Ref: ASSOCMLEADERACTIONBODY121491
|
||||
Ref: ASSOCNETWORK121942
|
||||
Ref: ASSOCNETWORKSURFACEACTIONBODY122853
|
||||
Ref: ASSOCOBJECTACTIONPARAM123180
|
||||
Ref: ASSOCOFFSETSURFACEACTIONBODY123525
|
||||
Ref: ASSOCORDINATEDIMACTIONBODY123891
|
||||
Ref: ASSOCOSNAPPOINTREFACTIONPARAM124336
|
||||
Ref: ASSOCPATCHSURFACEACTIONBODY125114
|
||||
Ref: ASSOCPATHACTIONPARAM125439
|
||||
Ref: ASSOCPERSSUBENTMANAGER126132
|
||||
Ref: ASSOCPLANESURFACEACTIONBODY128077
|
||||
Ref: ASSOCPOINTREFACTIONPARAM128406
|
||||
Ref: ASSOCRESTOREENTITYSTATEACTIONBODY129070
|
||||
Ref: ASSOCREVOLVEDSURFACEACTIONBODY129292
|
||||
Ref: ASSOCROTATEDDIMACTIONBODY129622
|
||||
Ref: ASSOCSWEPTSURFACEACTIONBODY130065
|
||||
Ref: ASSOCTRIMSURFACEACTIONBODY130396
|
||||
Ref: ASSOCVALUEDEPENDENCY130832
|
||||
Ref: ASSOCVARIABLE130965
|
||||
Ref: ASSOCVERTEXACTIONPARAM131923
|
||||
Ref: BLKREFOBJECTCONTEXTDATA132299
|
||||
Ref: BLOCKALIGNEDCONSTRAINTPARAMETER132649
|
||||
Ref: BLOCKALIGNMENTGRIP133802
|
||||
Ref: BLOCKALIGNMENTPARAMETER134375
|
||||
Ref: BLOCKANGULARCONSTRAINTPARAMETER135366
|
||||
Ref: BLOCKARRAYACTION136662
|
||||
Ref: BLOCKBASEPOINTPARAMETER137319
|
||||
Ref: BLOCKDIAMETRICCONSTRAINTPARAMETER137992
|
||||
Ref: BLOCKFLIPACTION139194
|
||||
Ref: BLOCKFLIPGRIP139867
|
||||
Ref: BLOCKFLIPPARAMETER140546
|
||||
Ref: BLOCKGRIPLOCATIONCOMPONENT141797
|
||||
Ref: BLOCKHORIZONTALCONSTRAINTPARAMETER142021
|
||||
Ref: BLOCKLINEARCONSTRAINTPARAMETER143186
|
||||
Ref: BLOCKLINEARGRIP144336
|
||||
Ref: BLOCKLINEARPARAMETER144906
|
||||
Ref: BLOCKLOOKUPACTION146019
|
||||
Ref: BLOCKLOOKUPGRIP146759
|
||||
Ref: BLOCKLOOKUPPARAMETER147281
|
||||
Ref: BLOCKMOVEACTION148014
|
||||
Ref: BLOCKPARAMDEPENDENCYBODY148716
|
||||
Ref: BLOCKPOINTPARAMETER148971
|
||||
Ref: BLOCKPOLARGRIP149684
|
||||
Ref: BLOCKPOLARPARAMETER150205
|
||||
Ref: BLOCKPOLARSTRETCHACTION151477
|
||||
Ref: BLOCKPROPERTIESTABLE152318
|
||||
Ref: BLOCKPROPERTIESTABLEGRIP152405
|
||||
Ref: BLOCKRADIALCONSTRAINTPARAMETER152937
|
||||
Ref: BLOCKREPRESENTATION154094
|
||||
Ref: BLOCKROTATEACTION154249
|
||||
Ref: BLOCKROTATIONGRIP154936
|
||||
Ref: BLOCKROTATIONPARAMETER155460
|
||||
Ref: BLOCKSCALEACTION156622
|
||||
Ref: BLOCKSTRETCHACTION157310
|
||||
Ref: BLOCKUSERPARAMETER158284
|
||||
Ref: BLOCKVERTICALCONSTRAINTPARAMETER159076
|
||||
Ref: BLOCKVISIBILITYGRIP160230
|
||||
Ref: BLOCKVISIBILITYPARAMETER160756
|
||||
Ref: BLOCKXYGRIP161701
|
||||
Ref: BLOCKXYPARAMETER162219
|
||||
Ref: BLOCK_CONTROL163504
|
||||
Ref: BLOCK_HEADER163804
|
||||
Ref: BREAKDATA165117
|
||||
Ref: BREAKPOINTREF165321
|
||||
Ref: CELLSTYLEMAP165396
|
||||
Ref: CONTEXTDATAMANAGER165572
|
||||
Ref: CSACDOCUMENTOPTIONS165780
|
||||
Ref: CURVEPATH165890
|
||||
Ref: DATALINK166046
|
||||
Ref: DATATABLE167000
|
||||
Ref: DBCOLOR167279
|
||||
Ref: DETAILVIEWSTYLE167396
|
||||
Ref: DICTIONARY169115
|
||||
Ref: DICTIONARYVAR169393
|
||||
Ref: DICTIONARYWDFLT169550
|
||||
Ref: DIMASSOC169865
|
||||
Ref: DIMSTYLE170163
|
||||
Ref: DIMSTYLE_CONTROL173984
|
||||
Ref: DMDIMOBJECTCONTEXTDATA174320
|
||||
Ref: DUMMY174650
|
||||
Ref: DYNAMICBLOCKPROXYNODE174734
|
||||
Ref: DYNAMICBLOCKPURGEPREVENTER174866
|
||||
Ref: EVALUATION_GRAPH175011
|
||||
Ref: FCFOBJECTCONTEXTDATA175436
|
||||
Ref: FIELD175716
|
||||
Ref: FIELDLIST176596
|
||||
Ref: GEODATA176780
|
||||
Ref: GEOMAPIMAGE178635
|
||||
Ref: GRADIENT_BACKGROUND179676
|
||||
Ref: GROUND_PLANE_BACKGROUND180066
|
||||
Ref: GROUP180486
|
||||
Ref: IBL_BACKGROUND180758
|
||||
Ref: IDBUFFER181089
|
||||
Ref: IMAGEDEF181269
|
||||
Ref: IMAGEDEF_REACTOR181606
|
||||
Ref: IMAGE_BACKGROUND181731
|
||||
Ref: INDEX182114
|
||||
Ref: LAYER182232
|
||||
Ref: LAYERFILTER182997
|
||||
Ref: LAYER_CONTROL183145
|
||||
Ref: LAYER_INDEX183374
|
||||
Ref: LAYOUT183575
|
||||
Ref: LEADEROBJECTCONTEXTDATA184543
|
||||
Ref: LIGHTLIST185013
|
||||
Ref: LONG_TRANSACTION185230
|
||||
Ref: LTYPE185298
|
||||
Ref: LTYPE_CONTROL186036
|
||||
Ref: MATERIAL186324
|
||||
Ref: MENTALRAYRENDERSETTINGS188149
|
||||
Ref: MLEADEROBJECTCONTEXTDATA190952
|
||||
Ref: MLEADERSTYLE191154
|
||||
Ref: MLINESTYLE193201
|
||||
Ref: MOTIONPATH193608
|
||||
Ref: MTEXTATTRIBUTEOBJECTCONTEXTDATA194005
|
||||
Ref: MTEXTOBJECTCONTEXTDATA194485
|
||||
Ref: NAVISWORKSMODELDEF195315
|
||||
Ref: OBJECT_PTR195644
|
||||
Ref: ORDDIMOBJECTCONTEXTDATA195730
|
||||
Ref: PARTIAL_VIEWING_INDEX196089
|
||||
Ref: PERSUBENTMGR196297
|
||||
Ref: PLACEHOLDER196761
|
||||
Ref: PLOTSETTINGS196836
|
||||
Ref: POINTCLOUDCOLORMAP198215
|
||||
Ref: POINTCLOUDDEF198756
|
||||
Ref: POINTCLOUDDEFEX199102
|
||||
Ref: POINTCLOUDDEF_REACTOR199454
|
||||
Ref: POINTCLOUDDEF_REACTOR_EX199587
|
||||
Ref: POINTPATH199705
|
||||
Ref: PROXY_OBJECT199865
|
||||
Ref: RADIMLGOBJECTCONTEXTDATA200312
|
||||
Ref: RADIMOBJECTCONTEXTDATA200660
|
||||
Ref: RAPIDRTRENDERSETTINGS200966
|
||||
Ref: RASTERVARIABLES201881
|
||||
Ref: RENDERENTRY202129
|
||||
Ref: RENDERENVIRONMENT203007
|
||||
Ref: RENDERGLOBAL203665
|
||||
Ref: RENDERSETTINGS204152
|
||||
Ref: SCALE204692
|
||||
Ref: SECTIONVIEWSTYLE204983
|
||||
Ref: SECTION_MANAGER207214
|
||||
Ref: SECTION_SETTINGS207419
|
||||
Ref: SKYLIGHT_BACKGROUND207638
|
||||
Ref: SOLID_BACKGROUND207801
|
||||
Ref: SORTENTSTABLE207962
|
||||
Ref: SPATIAL_FILTER208186
|
||||
Ref: SPATIAL_INDEX208763
|
||||
Ref: STYLE209083
|
||||
Ref: STYLE_CONTROL209785
|
||||
Ref: SUN210006
|
||||
Ref: SUNSTUDY210545
|
||||
Ref: TABLECONTENT211816
|
||||
Ref: TABLEGEOMETRY212074
|
||||
Ref: TABLESTYLE212320
|
||||
Ref: TEXTOBJECTCONTEXTDATA213182
|
||||
Ref: TVDEVICEPROPERTIES213565
|
||||
Ref: UCS213966
|
||||
Ref: UCS_CONTROL214667
|
||||
Ref: UNKNOWN_OBJ214894
|
||||
Ref: VBA_PROJECT214968
|
||||
Ref: VIEW215115
|
||||
Ref: VIEW_CONTROL216899
|
||||
Ref: VISUALSTYLE217127
|
||||
Ref: VPORT223132
|
||||
Ref: VPORT_CONTROL225385
|
||||
Ref: VX_CONTROL225613
|
||||
Ref: VX_TABLE_RECORD225843
|
||||
Ref: WIPEOUTVARIABLES226445
|
||||
Ref: XRECORD226561
|
||||
Ref: PDFDEFINITION226875
|
||||
Ref: UNDERLAYDEFINITION226875
|
||||
Ref: DGNDEFINITION227025
|
||||
Ref: DWFDEFINITION227078
|
||||
Ref: ASSOCARRAYMODIFYPARAMETERS227144
|
||||
Ref: ASSOCARRAYPARAMETERS227144
|
||||
Ref: ASSOCARRAYPATHPARAMETERS227481
|
||||
Ref: ASSOCARRAYPOLARPARAMETERS227548
|
||||
Ref: ASSOCARRAYRECTANGULARPARAMETERS227621
|
||||
Ref: Dwg_3DSOLID_material227683
|
||||
Ref: Dwg_3DSOLID_silhouette227879
|
||||
Ref: Dwg_3DSOLID_wire228253
|
||||
Ref: Dwg_ACSH_HistoryNode228854
|
||||
Ref: Dwg_ACSH_SubentColor229076
|
||||
Ref: Dwg_ACSH_SubentMaterial229273
|
||||
Ref: Dwg_ACTIONBODY229428
|
||||
Ref: Dwg_ARRAYITEMLOCATOR229616
|
||||
Ref: Dwg_ASSOCACTIONBODY_action229757
|
||||
Ref: Dwg_ASSOCACTION_Deps229922
|
||||
Ref: Dwg_ASSOCARRAYITEM230067
|
||||
Ref: Dwg_ASSOCPARAMBASEDACTIONBODY230528
|
||||
Ref: Dwg_ASSOCSURFACEACTIONBODY230914
|
||||
Ref: Dwg_AcDs231184
|
||||
Ref: Dwg_AcDs_Data232131
|
||||
Ref: Dwg_AcDs_DataBlob232265
|
||||
Ref: Dwg_AcDs_DataBlob01232547
|
||||
Ref: Dwg_AcDs_DataBlobRef232814
|
||||
Ref: Dwg_AcDs_DataBlobRef_Page233114
|
||||
Ref: Dwg_AcDs_DataIndex233200
|
||||
Ref: Dwg_AcDs_DataIndex_Entry233358
|
||||
Ref: Dwg_AcDs_Data_Record233479
|
||||
Ref: Dwg_AcDs_Data_RecordHdr233574
|
||||
Ref: Dwg_AcDs_Schema233727
|
||||
Ref: Dwg_AcDs_SchemaData233903
|
||||
Ref: Dwg_AcDs_SchemaData_UProp234181
|
||||
Ref: Dwg_AcDs_SchemaIndex234268
|
||||
Ref: Dwg_AcDs_SchemaIndex_Prop234597
|
||||
Ref: Dwg_AcDs_Schema_Prop234717
|
||||
Ref: Dwg_AcDs_Search234999
|
||||
Ref: Dwg_AcDs_Search_Data235112
|
||||
Ref: Dwg_AcDs_Search_IdIdx235373
|
||||
Ref: Dwg_AcDs_Search_IdIdxs235501
|
||||
Ref: Dwg_AcDs_Segment235609
|
||||
Ref: Dwg_AcDs_SegmentIndex236053
|
||||
Ref: Dwg_BLOCKACTION_connectionpts236151
|
||||
Ref: Dwg_BLOCKLOOKUPACTION_lut236242
|
||||
Ref: Dwg_BLOCKPARAMETER_PropInfo236477
|
||||
Ref: Dwg_BLOCKPARAMETER_connection236618
|
||||
Ref: Dwg_BLOCKPARAMVALUESET236705
|
||||
Ref: Dwg_BLOCKSTRETCHACTION_codes236971
|
||||
Ref: Dwg_BLOCKSTRETCHACTION_handles237187
|
||||
Ref: Dwg_BLOCKVISIBILITYPARAMETER_state237445
|
||||
Ref: Dwg_COMPOUNDOBJECTID237749
|
||||
Ref: Dwg_CONSTRAINTGROUPNODE237927
|
||||
Ref: Dwg_CONTEXTDATA_dict238165
|
||||
Ref: Dwg_CONTEXTDATA_submgr238333
|
||||
Ref: Dwg_CellContentGeometry238556
|
||||
Ref: Dwg_CellStyle239000
|
||||
Ref: Dwg_ColorRamp239906
|
||||
Ref: Dwg_ContentFormat240123
|
||||
Ref: Dwg_DATALINK_customdata240664
|
||||
Ref: Dwg_DATATABLE_column240816
|
||||
Ref: Dwg_DATATABLE_row241016
|
||||
Ref: Dwg_DIMASSOC_Ref241141
|
||||
Ref: Dwg_DIMENSION_common241817
|
||||
Ref: Dwg_EVAL_Edge242813
|
||||
Ref: Dwg_EVAL_Node243116
|
||||
Ref: Dwg_EvalExpr243427
|
||||
Ref: Dwg_EvalVariant243868
|
||||
Ref: Dwg_FIELD_ChildValue244104
|
||||
Ref: Dwg_FileDepList_Files244265
|
||||
Ref: Dwg_FormattedTableData244612
|
||||
Ref: Dwg_FormattedTableMerged244859
|
||||
Ref: Dwg_GEODATA_meshface245113
|
||||
Ref: Dwg_GEODATA_meshpt245229
|
||||
Ref: Dwg_GridFormat245319
|
||||
Ref: Dwg_HATCH_Color245737
|
||||
Ref: Dwg_HATCH_ControlPoint245905
|
||||
Ref: Dwg_HATCH_DefLine246063
|
||||
Ref: Dwg_HATCH_Path246329
|
||||
Ref: Dwg_HATCH_PathSeg246787
|
||||
Ref: Dwg_HATCH_PolylinePath247765
|
||||
Ref: Dwg_LAYER_entry247917
|
||||
Ref: Dwg_LEADER_ArrowHead248121
|
||||
Ref: Dwg_LEADER_BlockLabel248294
|
||||
Ref: Dwg_LEADER_Break248541
|
||||
Ref: Dwg_LEADER_Line248693
|
||||
Ref: Dwg_LEADER_Node249247
|
||||
Ref: Dwg_LIGHTLIST_light249827
|
||||
Ref: Dwg_LTYPE_dash249979
|
||||
Ref: Dwg_LWPOLYLINE_width250427
|
||||
Ref: Dwg_LinkedData250523
|
||||
Ref: Dwg_LinkedTableData250629
|
||||
Ref: Dwg_MATERIAL_color250898
|
||||
Ref: Dwg_MATERIAL_gentexture251072
|
||||
Ref: Dwg_MATERIAL_mapper251250
|
||||
Ref: Dwg_MESH_edge251696
|
||||
Ref: Dwg_MLEADER_AnnotContext251859
|
||||
Ref: Dwg_MLEADER_Content_Block252825
|
||||
Ref: Dwg_MLEADER_Content_MText253118
|
||||
Ref: Dwg_MLINESTYLE_line254117
|
||||
Ref: Dwg_MLINE_line254356
|
||||
Ref: Dwg_MLINE_vertex254602
|
||||
Ref: Dwg_OCD_Dimension254897
|
||||
Ref: Dwg_PARTIAL_VIEWING_INDEX_Entry255520
|
||||
Ref: Dwg_POINTCLOUDCOLORMAP_Ramp255729
|
||||
Ref: Dwg_POINTCLOUDEX_Croppings255960
|
||||
Ref: Dwg_POINTCLOUD_Clippings256381
|
||||
Ref: Dwg_POINTCLOUD_IntensityStyle256673
|
||||
Ref: Dwg_PROXY_LWPOLYLINE256931
|
||||
Ref: Dwg_R2004_Header257535
|
||||
Ref: Dwg_SECTION_geometrysettings258651
|
||||
Ref: Dwg_SECTION_typesettings259423
|
||||
Ref: Dwg_SPLINE_control_point259863
|
||||
Ref: Dwg_SUNSTUDY_Dates260056
|
||||
Ref: Dwg_SummaryInfo_Property260169
|
||||
Ref: Dwg_TABLEGEOMETRY_Cell260259
|
||||
Ref: Dwg_TABLESTYLE_CellStyle260635
|
||||
Ref: Dwg_TABLESTYLE_border261836
|
||||
Ref: Dwg_TABLESTYLE_rowstyles261962
|
||||
Ref: Dwg_TABLE_AttrDef262506
|
||||
Ref: Dwg_TABLE_BreakHeight262702
|
||||
Ref: Dwg_TABLE_BreakRow262876
|
||||
Ref: Dwg_TABLE_Cell263044
|
||||
Ref: Dwg_TABLE_CustomDataItem264755
|
||||
Ref: Dwg_TABLE_value264968
|
||||
Ref: Dwg_TableCell265561
|
||||
Ref: Dwg_TableCellContent266520
|
||||
Ref: Dwg_TableCellContent_Attr266926
|
||||
Ref: Dwg_TableDataColumn267127
|
||||
Ref: Dwg_TableRow267397
|
||||
Ref: Dwg_UCS_orthopts267808
|
||||
Ref: Dwg_VALUEPARAM267955
|
||||
Ref: Dwg_VALUEPARAM_vars268258
|
||||
Ref: Dwg_MLEADER_Content268358
|
||||
Ref: Common Entity fields268488
|
||||
Ref: Common Object fields270334
|
||||
Node: Sections270764
|
||||
Node: HEADER_273079
|
||||
Node: OBJECTS_273213
|
||||
Node: CLASSES273544
|
||||
Node: HANDLES274938
|
||||
Node: R2004_Header275324
|
||||
Node: UNKNOWN275616
|
||||
Node: SummaryInfo275838
|
||||
Node: Preview276642
|
||||
Node: VBAProject277007
|
||||
Node: AppInfo277127
|
||||
Node: AppInfoHistory277303
|
||||
Node: FileDepList277441
|
||||
Node: AcDS277644
|
||||
Node: RevHistory277845
|
||||
Node: Security277983
|
||||
Node: ObjFreeSpace278122
|
||||
Node: Template278276
|
||||
Node: AuxHeader278442
|
||||
Node: Signature278604
|
||||
Node: INFO278722
|
||||
Node: SYSTEM_MAP278863
|
||||
Node: Tables279034
|
||||
Node: EXTRAS280036
|
||||
Node: Structures282712
|
||||
Node: EED282909
|
||||
Node: XDATA285305
|
||||
Node: Functions285651
|
||||
Node: Decoding287111
|
||||
Node: Encoding289892
|
||||
Node: add api292570
|
||||
Node: dynapi296608
|
||||
Node: strings301358
|
||||
Node: Other Formats303478
|
||||
Node: DXF303818
|
||||
Node: DXFB304501
|
||||
Node: JSON304718
|
||||
Node: GeoJSON305606
|
||||
Node: Errors306632
|
||||
Node: Programs307972
|
||||
Ref: dwgread308159
|
||||
Ref: dwgwrite308781
|
||||
Ref: dxfwrite309002
|
||||
Ref: dwg2dxf309251
|
||||
Ref: dxf2dwg309743
|
||||
Ref: dwgrewrite310192
|
||||
Ref: dwglayers310405
|
||||
Ref: dwggrep311038
|
||||
Ref: dwgfilter311539
|
||||
Ref: dwg2SVG311827
|
||||
Ref: dwg2ps312372
|
||||
Ref: dwgplot312852
|
||||
Ref: load_dwg313115
|
||||
Ref: dwg2svg2313172
|
||||
Ref: unknown313490
|
||||
Ref: dwgfuzz313753
|
||||
Ref: dwgadd314429
|
||||
Node: Bindings314695
|
||||
Node: Reference API315327
|
||||
Node: Reporting bugs315858
|
||||
Node: GNU Free Documentation License317638
|
||||
Node: Index342792
|
||||
Node: General Index343028
|
||||
Node: Object and Field Index374711
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Local Variables:
|
||||
coding: utf-8
|
||||
End:
|
||||
13849
astral-service/static/lib/libredwg/share/info/LibreDWG.info-1
Normal file
13849
astral-service/static/lib/libredwg/share/info/LibreDWG.info-1
Normal file
File diff suppressed because it is too large
Load Diff
7538
astral-service/static/lib/libredwg/share/info/LibreDWG.info-2
Normal file
7538
astral-service/static/lib/libredwg/share/info/LibreDWG.info-2
Normal file
File diff suppressed because it is too large
Load Diff
18
astral-service/static/lib/libredwg/share/info/dir
Normal file
18
astral-service/static/lib/libredwg/share/info/dir
Normal file
@@ -0,0 +1,18 @@
|
||||
This is the file .../info/dir, which contains the
|
||||
topmost node of the Info hierarchy, called (dir)Top.
|
||||
The first time you invoke Info you start off looking at this node.
|
||||
|
||||
File: dir, Node: Top This is the top of the INFO tree
|
||||
|
||||
This (the Directory node) gives a menu of major topics.
|
||||
Typing "q" exits, "H" lists all Info commands, "d" returns here,
|
||||
"h" gives a primer for first-timers,
|
||||
"mEmacs<Return>" visits the Emacs manual, etc.
|
||||
|
||||
In Emacs, you can click mouse button 2 on a menu item or cross reference
|
||||
to select it.
|
||||
|
||||
* Menu:
|
||||
|
||||
Libraries
|
||||
* LibreDWG: (LibreDWG). Free implementation of the DWG file format.
|
||||
@@ -0,0 +1,65 @@
|
||||
# example dwgadd file. strings are utf8 and must not exceed length 255
|
||||
#readdwg "example_2000.dwg"
|
||||
#readdxf "example_2000.dxf"
|
||||
#readjson "example_2000.json"
|
||||
#version 2000
|
||||
HEADER.VIEWSIZE = 1.2345
|
||||
HEADER.ANGBASE = 90
|
||||
HEADER.LUPREC = 3
|
||||
HEADER.MENU = "other"
|
||||
HEADER.INSBASE = (1 0 0)
|
||||
HEADER.LIMMIN = (12 9)
|
||||
point (2 0 0)
|
||||
text "test" (0.0 1.0 0.0) 8
|
||||
block "bloko"
|
||||
attdef 8 0 "prompt" (0.0 1.0 0.0) TAG "default_text"
|
||||
line (0 1 0) (1 1 0)
|
||||
endblk
|
||||
insert (0 1 0) "bloko" 1 1 1 0
|
||||
attrib 8 0 (0.0 2.0 0.0) TAG "text1"
|
||||
minsert (0 1 0) "bloko" 1 1 1 0 1 2 1 1
|
||||
minsert.rotation = 90
|
||||
polyline_2d 2 ((0 1) (1 1))
|
||||
polyline_3d 2 ((0 1 0.5) (1 1 -0.5))
|
||||
lwpolyline 2 ((0 1) (1 1))
|
||||
arc (0.0 1.0 0.0) 0.5 0.0 3.0
|
||||
circle (0.0 1.0 0.0) 0.5
|
||||
polyline_pface 5 3 ((0 0 1) (2 0 1) (2 2 0) (1 2 0.5) (1 1 -0.5)) ((0 1 2 3) (1 2 -3 4) (2 -3 4))
|
||||
polyline_mesh 3 2 ((0 0 1) (2 0 2) (2 2 1) (1 2 0.5) (1 1 -1) (0 1 0))
|
||||
dimension_aligned (0 0 0) (2 0 0) (2 2 0)
|
||||
dimension_ang2ln (0 0 0) (2 0 0) (2 2 0) (2 2 0)
|
||||
dimension_ang3pt (0 0 0) (2 0 0) (2 1 0) (2 2 0)
|
||||
dimension_diameter (0 0 0) (2 0 0) 2
|
||||
dimension_ordinate (0 0 0) (2 0 0) 1
|
||||
dimension_radius (0 0 0) (2 0 0) 1
|
||||
dimension_linear (2 0 0) (2 1 0) (0 0 0) 90
|
||||
3dface (0 0 0) (2 0 0) (2 1 0) (0 2 0)
|
||||
solid (0 0 0) (2 0) (2 1) (0 2)
|
||||
trace (0 0 0) (2 0) (2 1) (0 2)
|
||||
shape "roman.shx" (0 0 0) 2 45
|
||||
ellipse (0 0 0) 2.0 0.75
|
||||
spline 3 ((0 0 0) (2 0 0) (2 1 0)) (0 2 0) (0 3 0)
|
||||
ray (0 0 0) (2 0 0)
|
||||
xline (0 0 0) (2 0 0)
|
||||
dictionary "ACAD_MATERIAL" "Global" 0
|
||||
xrecord dictionary "REFRACTIONTILE"
|
||||
mtext (0 1 0) 10 "test\ntext"
|
||||
leader 2 ((0 0 0) (0 1 0)) mtext 15
|
||||
tolerance "testtekst" (0 0 0) (0 0 1)
|
||||
mlinestyle "Double"
|
||||
mlinestyle.start_angle = 45
|
||||
mline 4 ((3.9 1.5 0) (3.2 1.8 0) (4.6 1.0 0) (3.8 1.7 0))
|
||||
dimstyle "Dim1"
|
||||
dimstyle.DIMSCALE = 2.0
|
||||
dimstyle.DIMUPT = 1
|
||||
ucs (0 0 0) (1 0 0) (2.5 0 0) "Ucs1"
|
||||
ucs.ucs_elevation = 1.0
|
||||
viewport "Viewport1"
|
||||
layout viewport "Model" "ANSI_A_(8.50_x_11.00_Inches)"
|
||||
torus (10 5 0) (0 0 1) 19 2.78
|
||||
sphere (10 5 0) (0 0 1) 15
|
||||
cylinder (10 5 0) (0 0 1) 15 5 5 5
|
||||
cone (10 5 0) (0 0 1) 15 5 5 0
|
||||
wedge (10 5 0) (0 0 1) 3.3 2.4 4.8
|
||||
box (10 5 0) (0 0 1) 3.3 2.0 2.5
|
||||
pyramid (10 5 0) (0 0 1) 4.5 4 2.0 2.5
|
||||
@@ -0,0 +1,32 @@
|
||||
# example dwgadd file for r10. strings are utf8 and must not exceed length 255
|
||||
HEADER.VIEWSIZE = 1.2345
|
||||
HEADER.ANGBASE = 90
|
||||
HEADER.LUPREC = 3
|
||||
HEADER.MENU = "other"
|
||||
HEADER.INSBASE = (1 0 0)
|
||||
HEADER.LIMMIN = (12 9)
|
||||
point (2 0 0)
|
||||
text "test" (0.0 1.0 0.0) 8
|
||||
block "BLOKO"
|
||||
attdef 8 0 "prompt" (0.0 1.0 0.0) TAG "default_text"
|
||||
line (0 1 0) (1 1 0)
|
||||
endblk
|
||||
insert (0 1 0) "BLOKO" 1 1 1 0
|
||||
attrib 8 0 (0.0 2.0 0.0) TAG "text1"
|
||||
polyline_2d 2 ((0 1) (1 1))
|
||||
polyline_3d 2 ((0 1 0) (1 1 0))
|
||||
arc (0.0 1.0 0.0) 0.5 0.0 3.0
|
||||
circle (0.0 1.0 0.0) 0.5
|
||||
polyline_pface 5 3 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0)) ((0 1 2 3) (1 2 3 4) (2 3 4 5))
|
||||
polyline_mesh 3 2 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0) (0 1 0))
|
||||
dimension_aligned (0 0 0) (2 0 0) (2 2 0)
|
||||
dimension_ang2ln (0 0 0) (2 0 0) (2 2 0) (2 2 0)
|
||||
dimension_ang3pt (0 0 0) (2 0 0) (2 1 0) (2 2 0)
|
||||
dimension_diameter (0 0 0) (2 0 0) 2
|
||||
dimension_ordinate (0 0 0) (2 0 0) 1
|
||||
dimension_radius (0 0 0) (2 0 0) 1
|
||||
dimension_linear (2 0 0) (2 1 0) (0 0 0) 90
|
||||
3dface (0 0 0) (2 0 0) (2 1 0) (0 2 0)
|
||||
solid (0 0 0) (2 0) (2 1) (0 2)
|
||||
trace (0 0 0) (2 0) (2 1) (0 2)
|
||||
shape "ROMAN.SHX" (0 0 0) 2 45
|
||||
@@ -0,0 +1,37 @@
|
||||
# example dwgadd file for r11. strings are utf8 and must not exceed length 255
|
||||
HEADER.VIEWSIZE = 1.2345
|
||||
HEADER.ANGBASE = 90
|
||||
HEADER.LUPREC = 3
|
||||
HEADER.MENU = "other"
|
||||
HEADER.INSBASE = (1 0 0)
|
||||
HEADER.LIMMIN = (12 9)
|
||||
point (2 0 0)
|
||||
text "test" (0.0 1.0 0.0) 8
|
||||
block "BLOKO"
|
||||
attdef 8 0 "prompt" (0.0 1.0 0.0) TAG "default_text"
|
||||
line (0 1 0) (1 1 0)
|
||||
endblk
|
||||
insert (0 1 0) "BLOKO" 1 1 1 0
|
||||
attrib 8 0 (0.0 2.0 0.0) TAG "text1"
|
||||
polyline_2d 2 ((0 1) (1 1))
|
||||
polyline_3d 2 ((0 1 0.5) (1 1 -0.5))
|
||||
arc (0.0 1.0 0.0) 0.5 0.0 3.0
|
||||
circle (0.0 1.0 0.0) 0.5
|
||||
polyline_pface 5 3 ((0 0 1) (2 0 1) (2 2 0) (1 2 0.5) (1 1 -0.5)) ((0 1 2 3) (1 2 -3 4) (2 -3 4))
|
||||
polyline_mesh 3 2 ((0 0 1) (2 0 2) (2 2 1) (1 2 0.5) (1 1 -1) (0 1 0))
|
||||
dimension_aligned (0 0 0) (2 0 0) (2 2 0)
|
||||
dimension_ang2ln (0 0 0) (2 0 0) (2 2 0) (2 2 0)
|
||||
dimension_ang3pt (0 0 0) (2 0 0) (2 1 0) (2 2 0)
|
||||
dimension_diameter (0 0 0) (2 0 0) 2
|
||||
dimension_ordinate (0 0 0) (2 0 0) 1
|
||||
dimension_radius (0 0 0) (2 0 0) 1
|
||||
dimension_linear (2 0 0) (2 1 0) (0 0 0) 90
|
||||
3dface (0 0 0) (2 0 0) (2 1 0) (0 2 0)
|
||||
solid (0 0 0) (2 0) (2 1) (0 2)
|
||||
trace (0 0 0) (2 0) (2 1) (0 2)
|
||||
shape "ROMAN.SHX" (0 0 0) 2 45
|
||||
dimstyle "DIM1"
|
||||
dimstyle.DIMSCALE = 2.0
|
||||
dimstyle.DIMUPT = 1
|
||||
ucs (0 0 0) (1 0 0) (2.5 0 0) "UCS1"
|
||||
ucs.ucs_elevation = 1.0
|
||||
@@ -0,0 +1,16 @@
|
||||
# example dwgadd file for r1.4. strings are utf8 and must not exceed length 255
|
||||
HEADER.TEXTSIZE = 1.2345
|
||||
HEADER.LUPREC = 3
|
||||
HEADER.INSBASE = (1 0)
|
||||
HEADER.LIMMIN = (12 9)
|
||||
point (2 0 0)
|
||||
text "test" (0.0 1.0 0.0) 8
|
||||
block "BLOKO"
|
||||
line (0 1 0) (1 1 0)
|
||||
endblk
|
||||
insert (0 1 0) "BLOKO" 1 1 1 0
|
||||
arc (0.0 1.0 0.0) 0.5 0.0 3.0
|
||||
circle (0.0 1.0 0.0) 0.5
|
||||
solid (0 0 0) (2 0) (2 1) (0 2)
|
||||
trace (0 0 0) (2 0) (2 1) (0 2)
|
||||
shape "ROMAN.SHX" (0 0 0) 2 45
|
||||
@@ -0,0 +1,23 @@
|
||||
# example dwgadd file for r2.10. strings are utf8 and must not exceed length 255
|
||||
HEADER.VIEWSIZE = 1.2345
|
||||
HEADER.LUPREC = 3
|
||||
HEADER.MENU = "other"
|
||||
HEADER.INSBASE = (1 0 0)
|
||||
HEADER.LIMMIN = (12 9)
|
||||
point (2 0 0)
|
||||
text "test" (0.0 1.0 0.0) 8
|
||||
block "BLOKO"
|
||||
attdef 8 0 "prompt" (0.0 1.0 0.0) TAG "default_text"
|
||||
line (0 1 0) (1 1 0)
|
||||
endblk
|
||||
insert (0 1 0) "BLOKO" 1 1 1 0
|
||||
attrib 8 0 (0.0 2.0 0.0) TAG "text1"
|
||||
polyline_2d 2 ((0 1) (2 3))
|
||||
polyline_3d 2 ((0 1 2) (3 4 5))
|
||||
arc (0.0 1.0 0.0) 0.5 0.0 3.0
|
||||
circle (0.0 1.0 0.0) 0.5
|
||||
polyline_pface 5 3 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0)) ((0 1 2 3) (1 2 3 4) (2 3 4 5))
|
||||
polyline_mesh 3 2 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0) (0 1 0))
|
||||
solid (0 0 0) (2 0) (2 1) (0 2)
|
||||
trace (0 0 0) (2 0) (2 1) (0 2)
|
||||
shape "ROMAN.SHX" (0 0 0) 2 45
|
||||
@@ -0,0 +1,32 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
#import libredwg
|
||||
from libredwg import *
|
||||
|
||||
import sys
|
||||
|
||||
if (len(sys.argv) != 2):
|
||||
print("Usage: load_dwg.py <filename>")
|
||||
exit()
|
||||
|
||||
filename = sys.argv[1]
|
||||
a = Dwg_Data()
|
||||
a.object = new_Dwg_Object_Array(1000)
|
||||
error = dwg_read_file(filename, a)
|
||||
|
||||
if (error > 0): # critical errors
|
||||
print("Error: ", error)
|
||||
if (error > 127):
|
||||
exit()
|
||||
|
||||
print(".dwg version: %s" % a.header.version)
|
||||
print("Num objects: %d " % a.num_objects)
|
||||
|
||||
#XXX TODO Error: Dwg_Object_LAYER_CONTROL object has no attribute 'tio'
|
||||
#print "Num layers: %d" % a.layer_control.tio.object.tio.LAYER_CONTROL.num_entries
|
||||
|
||||
#XXX ugly, but works
|
||||
for i in range(0, a.num_objects):
|
||||
obj = Dwg_Object_Array_getitem(a.object, i)
|
||||
print(" Supertype: " , obj.supertype)
|
||||
print(" Type: " , obj.type)
|
||||
38
astral-service/static/lib/libredwg/share/man/man1/dwg2SVG.1
Normal file
38
astral-service/static/lib/libredwg/share/man/man1/dwg2SVG.1
Normal file
@@ -0,0 +1,38 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWG2SVG "1" "February 2024" "dwg2SVG 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwg2SVG \- manual page for dwg2SVG 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwg2SVG
|
||||
[\fI\,OPTION\/\fR]... \fI\,DWGFILE >SVGFILE\/\fR
|
||||
.SH DESCRIPTION
|
||||
Converts some 2D elements of the DWG to a SVG.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-mspace\fR
|
||||
only model\-space, no paper\-space
|
||||
.TP
|
||||
\fB\-\-force\-free\fR
|
||||
force free
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwg2SVG
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwg2SVG
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
57
astral-service/static/lib/libredwg/share/man/man1/dwg2dxf.1
Normal file
57
astral-service/static/lib/libredwg/share/man/man1/dwg2dxf.1
Normal file
@@ -0,0 +1,57 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWG2DXF "1" "February 2024" "dwg2dxf 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwg2dxf \- manual page for dwg2dxf 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwg2dxf
|
||||
[\fI\,OPTION\/\fR]... \fI\,DWGFILES\/\fR...
|
||||
.SH DESCRIPTION
|
||||
Converts DWG files to DXF.
|
||||
Default DXFFILE: DWGFILE with .dxf extension in the current directory.
|
||||
Existing files are not overwritten, unless \fB\-y\fR is given.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.IP
|
||||
r12, r14, r2000, r2004, r2007, r2010, r2013
|
||||
.IP
|
||||
Planned versions:
|
||||
.IP
|
||||
r9, r10, r11, r2018
|
||||
.TP
|
||||
\fB\-m\fR, \fB\-\-minimal\fR
|
||||
only $ACADVER, HANDSEED and ENTITIES
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-binary\fR
|
||||
save as binary DXF
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-overwrite\fR
|
||||
overwrite existing files
|
||||
.TP
|
||||
\fB\-o\fR outfile, \fB\-\-file\fR
|
||||
optional, only valid with one single DWGFILE
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwg2dxf
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwg2dxf
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
52
astral-service/static/lib/libredwg/share/man/man1/dwgadd.1
Normal file
52
astral-service/static/lib/libredwg/share/man/man1/dwgadd.1
Normal file
@@ -0,0 +1,52 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGADD "1" "February 2024" "dwgadd 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgadd \- manual page for dwgadd 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwgadd
|
||||
[\fI\,OPTIONS\/\fR] \fI\,-o outfile addfile\/\fR
|
||||
.SH DESCRIPTION
|
||||
Create a DWG (or DXF, JSON) by adding entities with instructions from a special dwgadd file.
|
||||
See `man 5 dwgadd`
|
||||
.TP
|
||||
\fB\-\-dxf\fR:
|
||||
write DXF, not DWG
|
||||
.HP
|
||||
\fB\-\-binary\fR: write binary DXF, not DWG
|
||||
.TP
|
||||
\fB\-\-json\fR:
|
||||
write JSON, not DWG
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.IP
|
||||
r1.1, r1.2, r1.4, r2.6, r2.10, r9, r10, r11, r12, r14, r2000 (default)
|
||||
.IP
|
||||
Planned versions:
|
||||
.IP
|
||||
r2004, r2007, r2010, r2013, r2018
|
||||
.HP
|
||||
\fB\-o\fR outfile, \fB\-\-file\fR outfile (default: stdout)
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display the version and exit
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgadd
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgadd
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
33
astral-service/static/lib/libredwg/share/man/man1/dwgbmp.1
Normal file
33
astral-service/static/lib/libredwg/share/man/man1/dwgbmp.1
Normal file
@@ -0,0 +1,33 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGBMP "1" "February 2024" "dwgbmp 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgbmp \- manual page for dwgbmp 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwgbmp
|
||||
[\fI\,OPTION\/\fR]... \fI\,DWGFILE \/\fR[\fI\,thumbnailfile\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Extract the DWG thumbnail image as BMP, WMF or PNG.
|
||||
Default thumbnailfile: DWGFILE with the proper extension.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgbmp
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgbmp
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
@@ -0,0 +1,31 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGFILTER "1" "February 2024" "dwgfilter 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgfilter \- manual page for dwgfilter 0.13.3
|
||||
.SH DESCRIPTION
|
||||
dwgfilter [OPTIONS...] dwgfile
|
||||
.PP
|
||||
Allow custom jq queries on a temporary JSON dump.
|
||||
.PP
|
||||
OPTIONS: \fB\-\-help\fR,\-\-version
|
||||
.TP
|
||||
\fB\-\-debug\fR
|
||||
keep the tmp json
|
||||
.TP
|
||||
\fB\-i\fR
|
||||
write back in\-place, with an updating JQ query
|
||||
.TP
|
||||
\&...
|
||||
all other options are passed to jq. See 'man jq'
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgfilter
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgfilter
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
56
astral-service/static/lib/libredwg/share/man/man1/dwggrep.1
Normal file
56
astral-service/static/lib/libredwg/share/man/man1/dwggrep.1
Normal file
@@ -0,0 +1,56 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGGREP "1" "February 2024" "dwggrep 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwggrep \- manual page for dwggrep 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwggrep
|
||||
[\fI\,OPTIONS\/\fR]... \fI\,pattern files\/\fR
|
||||
.SH DESCRIPTION
|
||||
Search regex pattern in a list of DWGs.
|
||||
.TP
|
||||
\fB\-i\fR
|
||||
Case\-insensitive pattern
|
||||
.TP
|
||||
\fB\-x\fR
|
||||
Extended regex pattern
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-count\fR
|
||||
Print only the count of matched elements.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-no\-filename\fR
|
||||
Print no filename.
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-type\fR NAME
|
||||
Search only NAME entities or objects.
|
||||
.TP
|
||||
\fB\-d\fR, \fB\-\-dxf\fR NUM
|
||||
Search only DXF group NUM fields.
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-text\fR
|
||||
Search only in TEXT\-like entities.
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-blocks\fR
|
||||
Search also in all block definitions.
|
||||
.TP
|
||||
\fB\-\-tables\fR
|
||||
Search only in table names.
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
Display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
Output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwggrep
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwggrep
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
@@ -0,0 +1,42 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGLAYERS "1" "February 2024" "dwglayers 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwglayers \- manual page for dwglayers 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwglayers
|
||||
[\fI\,OPTION\/\fR]... \fI\,DWGFILE\/\fR
|
||||
.SH DESCRIPTION
|
||||
Print list of layers.
|
||||
.TP
|
||||
\fB\-x\fR, \fB\-\-extnames\fR
|
||||
prints EXTNAMES (r13\-r14 only)
|
||||
.IP
|
||||
i.e. space instead of _
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-flags\fR
|
||||
prints also flags:
|
||||
.IP
|
||||
3 chars for: f for frozen, + or \- for ON or OFF, l for locked
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-on\fR
|
||||
prints only ON layers
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwglayers
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwglayers
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
42
astral-service/static/lib/libredwg/share/man/man1/dwgread.1
Normal file
42
astral-service/static/lib/libredwg/share/man/man1/dwgread.1
Normal file
@@ -0,0 +1,42 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGREAD "1" "February 2024" "dwgread 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgread \- manual page for dwgread 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwgread
|
||||
[\fI\,OPTION\/\fR]... \fI\,DWGFILE\/\fR
|
||||
.SH DESCRIPTION
|
||||
Reads the DWG into some optional output format to stdout or some file,
|
||||
and prints error, success or verbose internal progress to stderr.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-O\fR fmt, \fB\-\-format\fR fmt
|
||||
fmt: DXF, DXFB, JSON, minJSON, GeoJSON
|
||||
.TP
|
||||
Planned output formats:
|
||||
YAML, XML/OGR, GPX, SVG, PS
|
||||
.TP
|
||||
\fB\-o\fR outfile
|
||||
also defines the output fmt. Default: stdout
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgread
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgread
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
@@ -0,0 +1,46 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGREWRITE "1" "February 2024" "dwgrewrite 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgrewrite \- manual page for dwgrewrite 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwgrewrite
|
||||
[\fI\,OPTION\/\fR]... \fI\,INFILE \/\fR[\fI\,OUTFILE\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Rewrites the DWG as another DWG.
|
||||
Default OUTFILE: INFILE with <\-rewrite.dwg> appended.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.IP
|
||||
r1.4, r2.6, r2.10, r9, r10, r11, r13, r14, r2000 (default)
|
||||
.IP
|
||||
Planned versions:
|
||||
.IP
|
||||
r2004, r2007, r2010, r2013, r2018
|
||||
.HP
|
||||
\fB\-o\fR dwgfile, \fB\-\-file\fR
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgrewrite
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgrewrite
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
54
astral-service/static/lib/libredwg/share/man/man1/dwgwrite.1
Normal file
54
astral-service/static/lib/libredwg/share/man/man1/dwgwrite.1
Normal file
@@ -0,0 +1,54 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DWGWRITE "1" "February 2024" "dwgwrite 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dwgwrite \- manual page for dwgwrite 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dwgwrite
|
||||
[\fI\,OPTION\/\fR]... [\fI\,-o DWGFILE\/\fR] \fI\,INFILE\/\fR
|
||||
.SH DESCRIPTION
|
||||
Writes a DWG file from various input formats. Only r2000 for now.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.TP
|
||||
r1.1, r1.2, r1.3, r1.4, r2.0, r2.10, r2.21, r2.22, r2.4,
|
||||
r2.5, r2.6, r9, r10, r11, r13, r14, r2000 (default)
|
||||
.IP
|
||||
Planned versions:
|
||||
.IP
|
||||
r2004\-r2021
|
||||
.TP
|
||||
\fB\-I\fR fmt, \fB\-\-format\fR fmt
|
||||
DXF, DXFB, JSON
|
||||
.IP
|
||||
Planned input formats: GeoJSON, YAML, XML/OGR, GPX
|
||||
.HP
|
||||
\fB\-o\fR dwgfile, \fB\-\-file\fR
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-overwrite\fR
|
||||
overwrite existing files
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dwgwrite
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dwgwrite
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
49
astral-service/static/lib/libredwg/share/man/man1/dxf2dwg.1
Normal file
49
astral-service/static/lib/libredwg/share/man/man1/dxf2dwg.1
Normal file
@@ -0,0 +1,49 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DXF2DWG "1" "February 2024" "dxf2dwg 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dxf2dwg \- manual page for dxf2dwg 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dxf2dwg
|
||||
[\fI\,OPTION\/\fR]... \fI\,DXFFILES \/\fR...
|
||||
.SH DESCRIPTION
|
||||
Converts the DXF to a DWG. Accepts ascii and binary DXF.
|
||||
Default DWGFILE: DXFFILE with .dwg extension in the current directory.
|
||||
Existing files are not overwritten, unless \fB\-y\fR is given.
|
||||
Encoding currently only works for R13\-R2000.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.IP
|
||||
r12, r14, r2000 (default)
|
||||
.IP
|
||||
Planned versions:
|
||||
.IP
|
||||
r9, r10, r11, r2004, r2007, r2010, r2013, r2018
|
||||
.TP
|
||||
\fB\-o\fR outfile, \fB\-\-file\fR
|
||||
optional, only valid with one single DXFFILE
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dxf2dwg
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dxf2dwg
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
56
astral-service/static/lib/libredwg/share/man/man1/dxfwrite.1
Normal file
56
astral-service/static/lib/libredwg/share/man/man1/dxfwrite.1
Normal file
@@ -0,0 +1,56 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DXFWRITE "1" "February 2024" "dxfwrite 0.13.3" "User Commands"
|
||||
.SH NAME
|
||||
dxfwrite \- manual page for dxfwrite 0.13.3
|
||||
.SH SYNOPSIS
|
||||
.B dxfwrite
|
||||
[\fI\,OPTION\/\fR]... [\fI\,-o DXFFILE\/\fR] \fI\,INFILE\/\fR
|
||||
.SH DESCRIPTION
|
||||
Writes a DXF file from various input formats.
|
||||
.TP
|
||||
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
|
||||
verbosity
|
||||
.TP
|
||||
\fB\-\-as\fR rNNNN
|
||||
save as version
|
||||
.IP
|
||||
Valid versions:
|
||||
.TP
|
||||
r9, r10, r11, r12, r13, r14, r2000, r2004, r2007,
|
||||
r2010, r2013, r2018, r2021
|
||||
.TP
|
||||
\fB\-I\fR fmt, \fB\-\-format\fR fmt
|
||||
DWG, DXF, DXFB, JSON
|
||||
.IP
|
||||
Planned input formats: GeoJSON, YAML, XML/OGR, GPX
|
||||
.HP
|
||||
\fB\-o\fR dxffile, \fB\-\-file\fR
|
||||
.TP
|
||||
\fB\-m\fR, \fB\-\-minimal\fR
|
||||
only $ACADVER, HANDSEED and ENTITIES
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-binary\fR
|
||||
create a binary DXF
|
||||
.TP
|
||||
\fB\-y\fR, \fB\-\-overwrite\fR
|
||||
overwrite existing files
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
output version information and exit
|
||||
.PP
|
||||
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B dxfwrite
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B dxfwrite
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info LibreDWG
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
264
astral-service/static/lib/libredwg/share/man/man5/dwgadd.5
Normal file
264
astral-service/static/lib/libredwg/share/man/man5/dwgadd.5
Normal file
@@ -0,0 +1,264 @@
|
||||
.\" -*- mode: troff; coding: utf-8 -*-
|
||||
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.45)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.de Vb \" Begin verbatim text
|
||||
.ft CW
|
||||
.nf
|
||||
.ne \\$1
|
||||
..
|
||||
.de Ve \" End verbatim text
|
||||
.ft R
|
||||
.fi
|
||||
..
|
||||
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
|
||||
.ie n \{\
|
||||
. ds C` ""
|
||||
. ds C' ""
|
||||
'br\}
|
||||
.el\{\
|
||||
. ds C`
|
||||
. ds C'
|
||||
'br\}
|
||||
.\"
|
||||
.\" Escape single quotes in literal strings from groff's Unicode transform.
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\"
|
||||
.\" If the F register is >0, we'll generate index entries on stderr for
|
||||
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
||||
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
||||
.\" output yourself in some meaningful fashion.
|
||||
.\"
|
||||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "DWGADD 5"
|
||||
.TH DWGADD 5 2023-12-23 0.13.3 "User Commands"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
.nh
|
||||
.SH NAME
|
||||
dwgadd.5 \- Format of the LibreDWG dwgadd example input\-file
|
||||
.SH DESCRIPTION
|
||||
.IX Header "DESCRIPTION"
|
||||
The dwgadd program accepts this input format to add entities and objects
|
||||
to a DWG file.
|
||||
.SH COMMANDS
|
||||
.IX Header "COMMANDS"
|
||||
commands start at each new line and must begin with a keyword and has optional arguments.
|
||||
.PP
|
||||
comments start with # and are ignored.
|
||||
.PP
|
||||
entities are created with the arguments as in the VBA object model AddEntity or AddObject methods.
|
||||
.PP
|
||||
entities are added to the model space by default, objects to the DWG or to parents objects, as e.g.
|
||||
with \f(CW\*(C`xrecord dictionary\*(C'\fR.
|
||||
.IP "\fBreaddwg\fR ""file.dwg""" 4
|
||||
.IX Item "readdwg ""file.dwg"""
|
||||
This must be the very first command. Otherwise a new, empty DWG Document is created.
|
||||
.IP "\fBreaddxf\fR ""file.dxf""" 4
|
||||
.IX Item "readdxf ""file.dxf"""
|
||||
This must be the very first command. Otherwise a new, empty DWG Document is created.
|
||||
.IP "\fBreadjson\fR ""file.json""" 4
|
||||
.IX Item "readjson ""file.json"""
|
||||
This must be the very first command. Otherwise a new, empty DWG Document is created.
|
||||
.IP \fBimperial\fR 4
|
||||
.IX Item "imperial"
|
||||
By default a new DWG is created as metric.
|
||||
There must be maximal one imperial line.
|
||||
.IP "\fBversion\fR number" 4
|
||||
.IX Item "version number"
|
||||
Writes the output file in this version. It accepts numbers only \f(CW\*(C`[0\-9.]+\*(C'\fR,
|
||||
prefixes it with an "r", and converts this string via \f(CWdwg_version_as("r"version)\fR
|
||||
to a \f(CW\*(C`Dwg_Version_Type\*(C'\fR. It accepts only valid DWG versions.
|
||||
There must be maximal one version line.
|
||||
.IP \fBpspace\fR 4
|
||||
.IX Item "pspace"
|
||||
Add further entities to the paper space.
|
||||
.IP \fBmspace\fR 4
|
||||
.IX Item "mspace"
|
||||
Add further entities to the model space again. This is only needed
|
||||
when a previous \f(CW\*(C`pspace\*(C'\fR command was used. mspace is the default.
|
||||
.IP "\fBHEADER\fR.\fIfield\fR = value" 4
|
||||
.IX Item "HEADER.field = value"
|
||||
Assign "VALUES" to a HEADER field. See the full documentation of valid HEADER fields.
|
||||
.IP "\fBpoint\fR (3dpoint)" 4
|
||||
.IX Item "point (3dpoint)"
|
||||
.PD 0
|
||||
.IP "\fBline\fR (3dpoint) (3dpoint)" 4
|
||||
.IX Item "line (3dpoint) (3dpoint)"
|
||||
.PD
|
||||
Create a line variable and entity. You may set all other fields via the
|
||||
\&\f(CW\*(C`line.field = value\*(C'\fR syntax. E.g. \f(CW\*(C`line.layer = "0"\*(C'\fR
|
||||
.IP "\fBray\fR (3dpoint) (3dpoint)" 4
|
||||
.IX Item "ray (3dpoint) (3dpoint)"
|
||||
.PD 0
|
||||
.IP "\fBxline\fR (3dpoint) (3dpoint)" 4
|
||||
.IX Item "xline (3dpoint) (3dpoint)"
|
||||
.IP "\fBtext\fR ""text_value"" (ins_pt) height" 4
|
||||
.IX Item "text ""text_value"" (ins_pt) height"
|
||||
.IP "\fBmtext\fR (ins_pt) height ""text_value""" 4
|
||||
.IX Item "mtext (ins_pt) height ""text_value"""
|
||||
.IP "\fBleader\fR num_points ((points)...) mtext type" 4
|
||||
.IX Item "leader num_points ((points)...) mtext type"
|
||||
.PD
|
||||
mtext must be the immediate previous command.
|
||||
.IP "\fBattribute\fR 8 0 ""prompt"" (0.0 1.0 0.0) ""tag"" ""text""" 4
|
||||
.IX Item "attribute 8 0 ""prompt"" (0.0 1.0 0.0) ""tag"" ""text"""
|
||||
.PD 0
|
||||
.IP "\fBattdef\fR 8 0 ""prompt"" (0.0 1.0 0.0) ""tag"" ""default_text""" 4
|
||||
.IX Item "attdef 8 0 ""prompt"" (0.0 1.0 0.0) ""tag"" ""default_text"""
|
||||
.IP "\fBblock\fR ""name""" 4
|
||||
.IX Item "block ""name"""
|
||||
.PD
|
||||
Starts a new block.
|
||||
.IP \fBendblk\fR 4
|
||||
.IX Item "endblk"
|
||||
Ends the current block.
|
||||
.IP "\fBinsert\fR (ins_pt) ""name"" xscale yscale zscale rotation" 4
|
||||
.IX Item "insert (ins_pt) ""name"" xscale yscale zscale rotation"
|
||||
.PD 0
|
||||
.IP "\fBminsert\fR (ins_pt) ""name"" xscale yscale zscale rotation numrows numcols rowspacing colspacing" 4
|
||||
.IX Item "minsert (ins_pt) ""name"" xscale yscale zscale rotation numrows numcols rowspacing colspacing"
|
||||
.IP "\fBpolyline\fR_2d numpts ((2dpoints) ...)" 4
|
||||
.IX Item "polyline_2d numpts ((2dpoints) ...)"
|
||||
.IP "\fBlwpolyline\fR numpts ((2dpoints) ...)" 4
|
||||
.IX Item "lwpolyline numpts ((2dpoints) ...)"
|
||||
.IP "\fBpolyline\fR_3d numpts ((3dpoints) ...)" 4
|
||||
.IX Item "polyline_3d numpts ((3dpoints) ...)"
|
||||
.IP "\fBarc\fR (center) radius startangle endangle" 4
|
||||
.IX Item "arc (center) radius startangle endangle"
|
||||
.IP "\fBcircle\fR (center) radius" 4
|
||||
.IX Item "circle (center) radius"
|
||||
.IP "\fBpolyline\fR_pface 5 3 ((3dpoints)...) ((faces_4ints)...)" 4
|
||||
.IX Item "polyline_pface 5 3 ((3dpoints)...) ((faces_4ints)...)"
|
||||
.IP "\fBpolyline\fR_mesh num_m_verts num_n_verts ((3dpoints)...)" 4
|
||||
.IX Item "polyline_mesh num_m_verts num_n_verts ((3dpoints)...)"
|
||||
.IP "\fBdimension\fR_aligned (xline1_pt) (xline2_pt) (text_midpt)" 4
|
||||
.IX Item "dimension_aligned (xline1_pt) (xline2_pt) (text_midpt)"
|
||||
.IP "\fBdimension\fR_ang2ln (center_pt) (xline1end_pt) (xline2end_pt) (text_midpt)" 4
|
||||
.IX Item "dimension_ang2ln (center_pt) (xline1end_pt) (xline2end_pt) (text_midpt)"
|
||||
.IP "\fBdimension\fR_ang3pt (center_pt) (xline1_pt) (xline2_pt) (text_midpt)" 4
|
||||
.IX Item "dimension_ang3pt (center_pt) (xline1_pt) (xline2_pt) (text_midpt)"
|
||||
.IP "\fBdimension\fR_diameter (chord_pt) (far_chord_pt) leader_len" 4
|
||||
.IX Item "dimension_diameter (chord_pt) (far_chord_pt) leader_len"
|
||||
.IP "\fBdimension\fR_ordinate (feature_location_pt) (leader_endpt) number" 4
|
||||
.IX Item "dimension_ordinate (feature_location_pt) (leader_endpt) number"
|
||||
.IP "\fBdimension\fR_radius (center_pt) (chord_pt) leader_len" 4
|
||||
.IX Item "dimension_radius (center_pt) (chord_pt) leader_len"
|
||||
.IP "\fBdimension\fR_linear (xline1_pt) (xline2_pt) (def_pt) angle" 4
|
||||
.IX Item "dimension_linear (xline1_pt) (xline2_pt) (def_pt) angle"
|
||||
.IP "\fB3dface\fR (pt1) (pt2) (pt3) [(pt4)]" 4
|
||||
.IX Item "3dface (pt1) (pt2) (pt3) [(pt4)]"
|
||||
.IP "\fBsolid\fR (pt1) (pt2\-2d) (pt3\-2d) (pt4\-2d)" 4
|
||||
.IX Item "solid (pt1) (pt2-2d) (pt3-2d) (pt4-2d)"
|
||||
.IP "\fBtrace\fR (pt1) (pt2\-2d) (pt3\-2d) (pt4\-2d)" 4
|
||||
.IX Item "trace (pt1) (pt2-2d) (pt3-2d) (pt4-2d)"
|
||||
.IP "\fBshape\fR ""name"" (3dpoint) scale angle" 4
|
||||
.IX Item "shape ""name"" (3dpoint) scale angle"
|
||||
.IP "\fBviewport\fR ""name""" 4
|
||||
.IX Item "viewport ""name"""
|
||||
.IP "\fBellipse\fR (center_pt) major_axis axis_ratio" 4
|
||||
.IX Item "ellipse (center_pt) major_axis axis_ratio"
|
||||
.IP "\fBspline\fR num_fitpts ((fitpts)...) (begin_tan_vector) (end_tan_vector)" 4
|
||||
.IX Item "spline num_fitpts ((fitpts)...) (begin_tan_vector) (end_tan_vector)"
|
||||
.IP "\fBdictionary\fR ""name"" ""key"" handle_ref" 4
|
||||
.IX Item "dictionary ""name"" ""key"" handle_ref"
|
||||
.IP "\fBxrecord\fR dictionary ""name""" 4
|
||||
.IX Item "xrecord dictionary ""name"""
|
||||
.IP "\fBtolerance\fR ""testtekst"" (0 0 0) (0 0 1)" 4
|
||||
.IX Item "tolerance ""testtekst"" (0 0 0) (0 0 1)"
|
||||
.IP "\fBmlinestyle\fR ""name""" 4
|
||||
.IX Item "mlinestyle ""name"""
|
||||
.IP "\fBmline\fR num_points ((points)...)" 4
|
||||
.IX Item "mline num_points ((points)...)"
|
||||
.IP "\fBlayout\fR viewport ""name"" ""canonical_media_name""" 4
|
||||
.IX Item "layout viewport ""name"" ""canonical_media_name"""
|
||||
.IP "\fBtorus\fR (center_pt) (normal) major_radius minor_radius" 4
|
||||
.IX Item "torus (center_pt) (normal) major_radius minor_radius"
|
||||
.IP "\fBsphere\fR (center_pt) (normal) radius" 4
|
||||
.IX Item "sphere (center_pt) (normal) radius"
|
||||
.IP "\fBcylinder\fR (center_pt) (normal) height major_radius minor_radius x_radius" 4
|
||||
.IX Item "cylinder (center_pt) (normal) height major_radius minor_radius x_radius"
|
||||
.IP "\fBcone\fR (center_pt) (normal) height major_radius minor_radius x_radius" 4
|
||||
.IX Item "cone (center_pt) (normal) height major_radius minor_radius x_radius"
|
||||
.IP "\fBwedge\fR (center_pt) (normal) length width height" 4
|
||||
.IX Item "wedge (center_pt) (normal) length width height"
|
||||
.IP "\fBbox\fR (center_pt) (normal) length width height" 4
|
||||
.IX Item "box (center_pt) (normal) length width height"
|
||||
.IP "\fBpyramid\fR (center_pt) (normal) height sides radius topradius" 4
|
||||
.IX Item "pyramid (center_pt) (normal) height sides radius topradius"
|
||||
.IP "\fBlayer\fR ""name""" 4
|
||||
.IX Item "layer ""name"""
|
||||
.IP "\fBstyle\fR ""name""" 4
|
||||
.IX Item "style ""name"""
|
||||
.IP "\fBltype\fR ""name""" 4
|
||||
.IX Item "ltype ""name"""
|
||||
.IP "\fBvport\fR ""name""" 4
|
||||
.IX Item "vport ""name"""
|
||||
.IP "\fBview\fR ""name""" 4
|
||||
.IX Item "view ""name"""
|
||||
.IP "\fBvport\fR ""name""" 4
|
||||
.IX Item "vport ""name"""
|
||||
.IP "\fBlayout\fR ""name""" 4
|
||||
.IX Item "layout ""name"""
|
||||
.IP "\fBgroup\fR ""name""" 4
|
||||
.IX Item "group ""name"""
|
||||
.IP "\fIentity\fR.\fIfield\fR = value" 4
|
||||
.IX Item "entity.field = value"
|
||||
.PD
|
||||
Every field of the just created entity or object can be set. See "VALUES"
|
||||
and the full documentation of the available entity fields.
|
||||
.SH VALUES
|
||||
.IX Header "VALUES"
|
||||
Acceptable values must be formatted as:
|
||||
.IP \fBinteger\fR 4
|
||||
.IX Item "integer"
|
||||
negative integers are allowed.
|
||||
\&\f(CW\*(C`0xXXX\*(C'\fR hex numbers are not accepted.
|
||||
.IP \fBfloat\fR 4
|
||||
.IX Item "float"
|
||||
floats may omit the dot.
|
||||
.IP "\fBangle\fR as float in degrees, not radians." 4
|
||||
.IX Item "angle as float in degrees, not radians."
|
||||
.PD 0
|
||||
.IP "\fBstring\fR in double-quotes" 4
|
||||
.IX Item "string in double-quotes"
|
||||
.PD
|
||||
E.g "string" or "" for the empty string.
|
||||
.IP "\fBpoint\fR as (float, float, [float])" 4
|
||||
.IX Item "point as (float, float, [float])"
|
||||
esp. (float float) for 2dpoint
|
||||
.Sp
|
||||
(float float float) for 3dpoint. (0 0 0) is a valid 3dpoint.
|
||||
.ie n .IP "\fBhandle\fR as ""D.D.XXX""" 4
|
||||
.el .IP "\fBhandle\fR as \f(CWD.D.XXX\fR" 4
|
||||
.IX Item "handle as D.D.XXX"
|
||||
<C[0\-12]> as type "." decimal digits as size "." hexadecimal absolute ref.
|
||||
For relative handle codes, like 6,8,10,12 do not take the 3rd handle part asis,
|
||||
but use the absolute ref.
|
||||
.Sp
|
||||
E.g. \f(CW5.1.15\fR for HEADER.LTYPE_BYLAYER.
|
||||
Reference in New Issue
Block a user