richsmith / sexytopo

The SexyTopo cave surveying app for Android
GNU General Public License v3.0
31 stars 14 forks source link

Symbols not (yet) exported to Therion #199

Closed CaverBruce closed 8 months ago

CaverBruce commented 1 year ago

The new direct drawing of symbols as points introduced in 1.8.0 beta look interesting. It looks as though the symbol points are not (yet) parsed to the Therion exports. That's OK, accept that this is beta. I'm wondering if there is an anticipated workflow that Therion users can use to include the symbols (and text labels - see #56 ) in XTherion th2 background images? Or an eventual plan to convert the text and symbols to stroked line paths in the exported xvi images?

richsmith commented 1 year ago

Yes, will be exported as Therion point symbols before releasing.

What are "XTherion th2 background images"? It would be definitely nicer to include the image in the XVI file as well as a Therion point, but I'm not sure if there's any way to do that. I don't think XVI files can have arbitrary images or more than simple paths? Ideas how to do it welcome :)

CaverBruce commented 1 year ago

For the reason I put forward in my initial post in #56 [raw survey notes should not be Therion point, line or areas, (because subsequent edits to obtain a nice output destroy ready reference to original field notes) and are better as background images].

XVI files are a type of XTherion background Image. Here is an example of someone's 'finger drawing' exported directly from ST.

image

Other formats accepted by XTherion are GIF, PNM, PPM, TH2, PNG and JPG. I have only ever used the latter three, and prefer PNG as it can include transparent background. Multiple background images can be inserted, and they can be moved (double right-click) but not scaled or rotated in XTHerion.

Options for symbol and text export, preferable first, could include:

  1. On export to xvi, render the point symbols and text labels as stroked paths. Pro: Uses current xvi definition. Con: Need to code the text and symbols as stroked paths.
  2. Create an option export to png, basically a scaled screenshot of ST drawing windows. Pro: Text labels and symbols are already rendered in ST window. Con: Need to convert to 'light mode' and scale and register png background image with the corresponding xvi export.
  3. Explore inclusion of point symbols and labels in XVI format. Pro: MIGHT be an elegant solution. Con: Needs buy-in from at least three App developers. Probably intensive effort required.
  4. Export to Therion Point symbols. Pro: You presumably have an idea how this might be done and register it with the accompanying xvi. Con: Mixing paradigms - an image to be traced in XTherion with native Therion objects, and as in first sentence of this post.

My 'guess' is that 2 would be easiest to implement. If the png and xvi scales can be made to match from the ST coding side, then it would be a simple matter for a user to manually insert the png file and register it against the xvi if they so wished.

The above only deals with text labels. There are also station comments that need to be exported. Probably these should be exported to the TH file as comments rather than the TH2 or XVI file (maybe this has been implemented, I have not checked).

richsmith commented 1 year ago

I've done the SVG symbol export, which was not too hard, as I started from SVG images for symbols. I don't suppose XVI format can handle SVGs?

  1. Would be good, but hard... the symbol SVGs contain elements which AFAIK aren't commands in XVI format.
  2. Yuck... maybe. Unless I can find a library that converts SVG images to PNG from inside Android - then I can reuse the existing code :thinking:
  3. Don't think I have the time or motivation to coordinate this...
  4. Text labels are already exported as Therion labels. I'm planning to do the same for point symbols, but it would be nicer if I could output them to on the "background" image as well.

maybe this has been implemented, I have not checked

Yes, this was done quite a while ago.

CaverBruce commented 1 year ago

Disregard the bit about TH2 as background images - I was thinking of something else and got confused. I'll check export of text labels and station comments when I have a moment - haven't noticed them for some reason...

richsmith commented 8 months ago

I'll check export of text labels and station comments when I have a moment - haven't noticed them for some reason...

Ah, turns out I imagined that I had done text label outputs :laughing:

The latest release going to beta today has text label outputs and symbols. At some point I'll see if I can output a better background image. The SVG output seems to work well.

CaverBruce commented 6 months ago

Just giving 1.8.0 a spin. Station comments export to .th file: Good. Symbols and text labels export to a single scrap in .th2 (so are not rendered in xvi). The information is preserved, but does not retain original drawing in background image. Attempting to export to svg (as a means of working around lack of rendering in xvi) results in an unreadable file - I will admit to being svg incompetent - sample file attached. Test180 plan

How high up the list is improving xvi/th2 background image content?