Rotate a block in DXF file format - rotation

I am creating a DXF file using XSLT to transform my raw data.
I can create a working DXF file with a block and insert it into my drawing.
The issue is I want to create one block that is used many times but is translated and rotated each time it is inserted. Looking up the reference document for DXF, the INSERT group only contains ‘50’ (which is rotation group code). I need to rotate the block upon each insertion around it’s X and Y axis. (OCS, not WCS).
I cannot see a way to do this, but the concept of blocks is to be referenced multiple times in many different orientations, so I find it hard to believe there is not a way to do this.
A long work around is to create a block for each transform but this defeats the purpose and involves me calculating each coordinate, not to mention dramatically increases the file size.
There is also the extrusion group code (210,220,230) but I cannot figure out if I could achieve what I want using this, as these work around the WCS.

Related

Align image pairs with high accuracy

I have series of photos with different view of almost flat object.
One part of object depends on view and I want to detect it.
So I detect keypoints, find matches and wrap photos, they looks almost aligned after that but because object almost flat (not ideally) there some distortion.
I have tried to detect more keypoints on wrapped pairs to get dense matches, did interpolation and got correction map which I applyed on image. But result still not precise. May be because it hard to get map by interpolation for sparse points.
Could you give me some advises how to solve this task? I think there should be a proven solution for this common task.

CARTO Animation Time Series Map

Hello I am making a animation time series map in CARTO builder. The animation works fine, but I would like my points to continuously move from point A to B, not just populate from point A to B like its doing now if theres a vast distance for the particular ID for that point. I know this would work if I had many more coordinates filling in from point A to B like in this example, but I don't. So is there a way to do this in cartodb?
CARTO BUILDER allows you to analyze and visualize your data according to your values. So as you pointed out, you would need to enrich your dataset with data among those dates and locations. Regarding dates, you can use generate_series PostgreSQL function as explained here. In relation to generating points between two coordinates, you would need to create a line (via Connect with lines analysis or ST_MakeLine) and then apply ST_DumpPoints).

Grouping rectangles in iTextSharp

I have multiple rectangles and they all share the same spot color. Is there a way to merge / group them into one vector object so the generated pdf has smaller size?
If you are creating the document from scratch, then the answer is trivial: yes!
It's sufficient to draw all the paths of the rectangles that share the same spot color and then use the operator that fills, stroke or fills & strokes the paths.
If you are talking about optimizing an existing PDF document, you're in for some heavy programming. You would need to parse every content stream looking for rectangle operators (assuming that the rectangles aren't drawn using move-to and line-to operators), check where these shapes are filled and/or stroked, and then rearrange all these operators. This would require a lot of thought. I would know where to begin, but I can't predict where it would end. Maybe it would turn out that it makes more sense to define a single rectangle as a Form XObject and reuse that single external object, maybe not. It's hard to predict.
Moreover: you are talking about operators in a stream. These streams are compressed anyway, so you may be doing a lot of work to gain only a very small decrease in size.
I would say: what you are asking for may be possible, but it is unclear why you would do this, because it would result in only a limited decrease in file size.
If size is an issue, there may be other places where you are "wasting bytes" that could result in a more desirable result. I am very curious to hear why you think the rectangles using spot colors are the culprit. You are reusing the spot color instance, aren't you? If you are creating a new spot color instance for every rectangle you draw, you have found the real culprit and you can avoid having to group the rectangles.

Three.js How to increase canvas-text texture quality

What parameters, modes, tricks, etc can be applied to get sharpness for texts ?
I'm going to draw a lot so I cant use 3d text.
I'm using canvas to write the text and some symbols. I'm creating somethinbg like label information.
Thanks
This is no simple matter since you'll run into memory issues with 100k "font textures". Since you want 100k text elements you'll have several difficulties to manage. I had a similar problem too once and tossed together a few techniques in order to make it work. Simply put you need some sort of LOD ("Level of Detail") to make that work. That setup might look like following:
A THREE.ParticleSystem built up with BufferGeometry where every position is one text-position
One "highres" TextureAtlas with 256 images on it which you allocate dynamically with those images that are around you (4096px x 4096px with 256x256px images)
At least one "lowres" TextureAtlas where you have 16x16px images. You prepare that one beforehand. Same size like previous, but there you have all preview images of your text and every image is 16x16px in size.
A kdtree data structure to use a nearestneighbour algorithm with to figure out which positions are near the camera (alike http://threejs.org/examples/#webgl_nearestneighbour)
The sub-imaging module to continually replace highres textures with directly on the GPU: https://github.com/mrdoob/three.js/pull/4661
An index for every position to tell it which position on the TextureAtlas it should use for display
You see where I'm going. Here's some docs on my experiences:
The Stackoverflow post: Display many thousand images in three.js
The blog where I (begun) to explain what I was doing: http://blogs.fhnw.ch/threejs/
This way it will take quite some time until you have satisfying results. The only way to make this simpler is to get rid of the 16x16px preview images. But I wouldn't recommend that... Or of course something depending on your setup. Maybe you have levels? towns? Or any other structure where it would make sense to only display a portion of these texts? That might be worth a though before tackling the big thing.
If you plan to really work on this and make this happen the way I described I can help you with some already existing code and further explanations. Just tell me where you're heading :)

Writing a command line scene parser for 3DS Max 2010

I am trying to find out if its possible at all to write a command line scene parser for 3ds max 2010.
I want to gather some information from the max scene without having to load up the Max studio. I have been informed that its not possible to access the Max API without starting the max studio.
Possible use of my program
C:\myparser.exe "myfile.max" > bonenames.txt
Any help/suggestions/hacks are greatly appreciated :)
Thanks
Most anything is possible with enough time, experience, and resources. But what you are suggesting is generally not feasible unless you:
Have full documentation on the binary file format of 3ds Max 2010, or
Need to extract an exceptionally small amount of information from the scene.
If you are only attempting to extract bone names from the file—and only for actual bone objects instead of arbitrary geometry used as a bone—there is a chance (albeit very slim) that creating many files that differ in very minor ways might allow you perform a binary diff and deduce some patterns from the contents.
For example, save an empty Max scene, then add one bone to it and save that, then rename the bone (using the same number of characters) and save that, then rename the bone to add one character and save that, then move the bone and save that, then add another bone and save that. Then try adding modifiers, or param blocks, or hiding the bone, or moving it to another layer, etc. etc. and see what you get. With luck there might be a sensible pattern among the layers of cruft that you can parse for yourself.

Resources