Minor improvements for Ab3d.Reader3ds, Ab2d.ReaderWmf and Ab2d.ReaderSvg published

by abenedik 15. January 2013 13:54

I would like to inform you that new versions for Ab3d.Reader3ds, Ab2d.ReaderWmf and Ab2d.ReaderSvg has been published.

The new version contains a fix for generating object names for exported XAML. A bug in one of the previous version prevented the exporter code to check and fix the object's name.

There is also an additional minor improvement in Ab2d.ReaderWmf library that now correctly position text is some of the rare cases.

Tags: , ,

Reader3ds | ReaderSvg | ReaderWmf

New version of our products brings improved support for Windows 8 and some other goodies

by abenedik 28. December 2012 10:55

I am very happy to announce that a new version of all our products is available.

The biggest improvement of the new version is better support for Window 8. This includes improved installer that now works correctly without .Net 2.0 installed on the system. Also the Viewer3ds, ViewerSvg and Paste2Xaml applications are now build on .Net 4.0 framework and do not require .Net 3.5 any more. The applications also use different obfuscation method - the previous obfuscation crashed the applications on startup in Windows 8.

What is more, the ViewerSvg and Paste2Xaml now fully support exporting XAML for Windows Store applications (Windows Runtime). This means that you can use almost any svg file, metafile or get drawing from clipboard and use ViewerSvg or Paste2Xaml to create vector graphics for Windows Store applications.

With this release all libraries now target .Net 3.5 Client profile (before some of them targered .Net 3.0).
As before all the libraries also contain an additional assembly that is built on .Net 4.0 framework.


This version also brings some additional improvements to Ab3d.PowerToys, Ab3d.Reader3ds and ZoomPanel libraries.

The following are the changed in the Ab3d.PowerToys:

  • Added GetCameraPosition method to BaseCamera.
  • Fixed creating geometry for Visual 3D objects when no property is changed on the visual (for example if default size is used).
  • Fixed showing long 3D lines that cross the near camera plane (before such lines were not correctly shown).
  • Improved measuring size of CameraControlPanel - now it is possible to define only desired Width or Height and the control automatically sets the other (Height or Width).
  • In MouseCameraController the StartMouseProcessing and EndMouseProcessing are now protected virtual and can be overriden (before they were private).
  • Improved creation of sphere mesh - before some triangles were defined in such a way that they represented a line instead of triangle (two positions in the triangle were defined in the same position in space).
  • Added possibility to create a slightly improved sphere mesh when there is no need to create texture coordinates (this can be done with specifying generateTextureCoordinates as false in the Ab3d.Meshes.SphereMesh3D constructor).
  • Added DumpMatrix3D to Dumper class.
  • Improved FpsMeter when custom DisplayFormatString property is set.
  • Fixed creating PolyLines when they are created with duplicate positions - Index out of range exception was thrown before.


Scene editor in Ab3d.PowerToys samples

There is also a new and very interesting sample available with the new Ab3d.PowerToys. A screenshot from the sample is shown in the image above. The sample is showing how to create a simple 3D editor. It allows the user to create 3D boxes with the mouse (the current position of the mouse in the 3D scene is shown with two green lines). The box is created by first defining the base rectangle with dragging the mouse and then defining the height with moving the mouse up and clicking at desired height. The sample also shows how to create simple snap to grid. User can rotate or move the camera around. It is also possible to change camera to show all the objects (zoom to content).

The Ab3d.PowerToys help has also been improved. It now contains the "Quick start tutorial" that is basically the content of one of my previous blog posts. What is more, there is also a "Tips and Tricks" help section that describes some techniques that can help or improve working with WPF 3D. I will write the content of that help section in my next post.


And the following are two additional changed in Ab3d.Reader3ds:

  • Added CreateTextureCallback delegate to Reader3ds - it can be used to customize the process of creating the texture images.
  • Fixed reading 3ds files that define material with names longer than 17 characters (the 3ds documentation defines max length of material name to be 17 characters - but it looks that in reality the material names can be longer).


As mentioned before, ZoomPanel also has an improvement. But not in the library itself but as an additional sample that describes how to limit the zoom to specific zoom factor.


As always if you are new to our tools, you are most welcome to download a 60-day trial from the Download page. Existing customers can get the updated versions from their User Account page.

Tags: , , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf | ZoomPanel

New release brings improved products, added .Net 4 assemblies and better installer

by abenedik 23. August 2012 22:23

This release brings the following:

-    improved installation on 64 bit Windows
-    added .Net 4 assemblies
-    improved Ab3d.PowerToys, Ab3d.Reader3ds and ZoomPanel libraries



The new installer has been improved to work better on 64 bit windows. Now the products are no longer installed under “Program Files (x86)” folder, but under “Program Files”. All the products are built with “Any CPU” setting and therefore do not need to be in the folder where all the “old stuff” is. Note that if you were referencing our products from the x86 folder, you will need to update the path to our products.

All the products now also contain assemblies that are built on .Net 4.0 Client Profile framework. When building .Net 4.0 applications, you can now reference native .Net 4 assemblies. Before you had to reference original .Net 3.0 (Ab3d.Reader3ds, Ab2d.ReaderSvg, Ab2d.ReaderWmf or ZoomPanel) or .Net 3.5 SP1 (Ab3d.PowerToys) assemblies. This was not a problem because the 4.0 CLR runs the assemblies on previous target frameworks natively inside 4.0 CLR (without running them in some kind of virtual machine). So it was already possible to use our libraries on machines where only .Net 4.0 is installed. Anyway time goes on and now almost all new applications are built on 4.0 so I decided to prepare native builds for that framework. Of course the original 3.0 and 3.5 assemblies are still available. Original assemblies are inside bin folder as before. The new assemblies can be found inside bin\.Net 4 folder.


Because all our products except Ab2d.ReaderWmf are using AllowPartiallyTrustedCallers assembly attribute, I had to take a closer look at the security critical sections of the code and add some security related attributes on some methods. This made the code .Net 4.0 compliant.

Note that the Viewer3ds, ViewerSvg and Paste2Xaml applications were not ported to .Net 4.0 and still requires older framework to run (older applications cannot run inside 4.0 CLR - only assemblies can be used inside 4.0 applications).

 

As mentioned before some of the products were also improved.


ZoomPanel library got improved ZoomPanelMiniMap control. Here controlling ZoomPanel with moving rectangle around was improved (before movements were slow). In the previous version it could happen that when a content of ZoomPanel was changed from a big to a much smaller content, than the new image in ZoomPanelMiniMap was too small. This is fixed now.

Ab3d.Reader3ds library also got a few improvements. Most of the work there was done to improve reading of broken 3ds files. Because 3ds file is very old and very commonly used, there are many applications out there that can export to that file format. Unfortunately not all of them create valid 3ds files. I got some of such files. Most of them were so screwed that it was not possible to import them into 3D Studio Max (invalid file format error was shown). Despite that there were still some valid data inside those files. And the new version tries to read as much from them as possible.

In case when a broken 3ds file is read with Reader3ds, you will still get FileFormatException (when reading with default settings). But now you can catch the exception. Than you can warn the user about problematic file and if the user wants to read the file anyway, you can set the new TryToReadBrokenFiles property on Reader3ds to true and read the file again. You can also have that property always true and just check the IsBroken property after reading 3ds file. Both those options are also used in the new version of Viewer3ds.

One nice new feature of Viewer3ds is showing object’s bounding box, triangles and normal. This is very useful in finding the cause of the problems in some 3D objects that do not look correct. Because Viewer3ds uses powerful 3D lines capabilities of Ab3d.PowerToys library this was an easy task to do. The following screenshot shows that new feature:

Viewer3ds: Showing details of selected object - bounding box in red, triangles in green and normals in blue.

The longest list of new features for this release belongs to Ab3d.PowerToys library. Today I will just write short descriptions of new features. In one of the following posts I will discuss some of them in more details. So the improvements are:
-    Improved LinesUpdater performance and removed possible memory leaks.
-    Added Reset method to LinesUpdater that takes Viewport3D as parameter to reset (remove all lines) only from specific Viewport3D.
-    Added HeightMapVisual3D and HeightMapMesh3D (with two very nice samples)
-    Added TubeMesh3D, TubeVisual3D and TubeUIElement3D.
-    Added support to very easily create 3D curves: added Ab3d.Utilities.BezierCurve and Ab3d.Utilities.BSpline classes; also added CreateBSpline3D and CreateNURBSCurve3D to Line3DFactory.
-    Added MouseWheel event to EventManager3D – now you can subscribe to MouseWheel event on any Model3D object.

Ab3d.ReaderSvg and Ab2d.ReaderWmf libraries did not get any new features of fixes. But they also got new versions (with same major and minor version but increased build version) because of new .Net 4.0 assemblies and small changes that were needed in the code to make the code 4.0 compliant.

Tags: , , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf | ZoomPanel

Maintenance releases for Ab2d.ReaderSvg and Ab2d.ReaderWmf published

by abenedik 28. May 2012 08:00

I am happy to announce that maintenance releases are now available for Ab2d.ReaderWmf and Ab2d.ReaderSvg.

The improvements and fixes in Ab2d.ReaderWmf are:

  • Improved scaling of text. Before sometimes the text was not correctly scaled - for example when pasting cells from excel the text can go out of bounds. The text is scaled with RenderTransform on TextBlocks. Note that scaling can be turned off with setting ProcessCharacterSpacing property to false.
  • Added support for text that is defined by glyphs indexes instead of unicode characters (usually when the metafile was created from the data that was sent to printer).
  • Fixed processing character spacing for special charter marks that are shown over another character like carets, etc.
  • Fixed exporting to XAML when the content of the Text property contains curly brackets. Before parser wanted to use them for binding expression.
  • Added ResolveRasterOperation delegate that enables using custom brush when an unsupported raster operation is used in metafile.

 

The following are the changes in Ab2d.ReaderSvg:

  • Fixed exporting to XAML when the content of Text property contains curly brackets. Before parser wanted to use them for binding expression.
  • Prevented throwing ArgumentException when right or bottom value in object's bounds was negative.

 

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , ,

ReaderSvg | ReaderWmf

New version of Ab2d.ReaderSvg available

by abenedik 1. August 2011 10:19

I am happy to announce that the new version of Ab2d.ReaderSvg library is available.

The version adds improved support for svg use and embedded svg elements. Those two svg elements are now correctly placed and have the correct size.

The new version also provides two new properties that can be used to fix problems that are caused by the differences between WPF and svg.

The first new property is SwitchElementProcessingType. It specifies which children of the svg switch element will be imported and shown. The switch element in svg file defines children that are shown based on the conditions defined in switch element. Because it is not possible to process svg conditions in WPF, it is possible to choose how the children will be imported and which children will be shown. The possible values for SwitchElementProcessingType are:

  • Disabled - svg switch element will not be imported.
  • ShowFirstDiscardOthers - only the first switch child will be imported. Other children will not be imported.
  • ShowFirstHideOthers - all switch children will be imported. Only the first element will be shown. Other children will have their Visibility set to Hidden.
  • ShowFirstCollapseOthers (default) - all switch children will be imported. Only the first element will be shown. Other children will have their Visibility set to Collapsed.
  • ShowAll - all switch children will be imported and shown.

 

The second new property is OverrideMiterLimit. The property has been added because WPF renders miter limit line cab differently as they are defined in svg specifications. The miter lime cabs show sharp line edges. But when the two lines meet at low angle, the sharp edge could extend very far away from the line junction. Therefore the miter limit can limit the sharp edges. In WPF the miter limit is used to specify how far away the sharp edge is allowed to go. In svg, the miter limit defined at which angle the miter limit is converted into beveled edge. This difference can lead to some anomalies when importing svg files. In this case the OverrideMiterLimit can be used to override the miter limit specified in the svg file and use value 1 or 2 instead.

For more information about the differences please see forum thread about this.

For backwards compatibility by default the miter limit defined in svg file is used (OverrideMiterLimit = 0).

 

Both new properties can be also set in the new ViewerSvg (here the default OverrideMiterLimit is set to 2 - miter limit of 2 is used by default).

Tags: , , ,

ReaderSvg

New maintenance release with many improvements for metafile reader

by abenedik 20. April 2011 23:42

This release brings many improvements to almost all our products.

The metafile reader (Ab2d.ReaderWmf) library got most of the changes. The svg reader (Ab2d.ReaderSvg) also got a few new features. There were also some improvements that affected all the products except ZoomPanel. ZoomPanel control was left out of this release because the library is waiting for a major upgrade. Now when this release is out I will finally start working on it (many things are already prepared - like mini map, rotate the content, zoom slider, etc. - they just need to be polished and tested).

Let me first describe the changes that affected all the products (except ZoomPanel):

  • The licensing dialogs are now created in WPF and not in Windows Forms as before (this skips loading Windows Forms and other related assemblies and therefore speeds up the application start - especially in evaluation version).
  • Improved commercial license code that tries to find embedded resources - this code is now much faster.
  • Added splash screens to all of the converter applications.

Besides the changes above the Ab3d.Reader3ds and Ab3d.PowerToys libraries did not get any new features.

 

But as mentioned before the Ab2d.ReaderWmf library was improved quite significantly. The code that transformed positions data from metafile into WPF was rewritten from ground up. The new version now enables to specify in which units the read positions will be - they can be in Pixels, Millimeters, Inches or GdiCompatable units. This can be useful when the drawing for example in Microsoft Visio is created in millimeters, the WPF elements that are created with pasting the drawing into Paste2Xaml can be also defined in millimeters. When the default Pixel units are used, the size of the read metafile is now the same as the size that is shown when the metafile is opened by Windows.

This is the list of changes in Ab2d.ReaderWmf library:

  • Added MetafileUnits property. It specifies the units in which the metafile is read. By default its value is set to Pixel. It can be also set to Millimeter, Inch or GdiCompatable. This can be useful to preserve the positions and other properties when the drawing is created in millimeter or inch units.
  • Added AutoSize property - defines if size of the root canvas is get from metafiles bounds or its frame. When bounds is used, the root canvas size is just as big as its containing objects.
  • Added GetSize(units) method that can be used to get the size of the read metafile in the specified units.
  • The size of the read metafile is now by default (if MetafileUnits is Pixel) the same as the size shown when metafile is opened by Window.
  • Improved reading metafiles that use MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH or MM_TWIPS mapping mode.
  • When reading polyline from a metafile and it has only 2 points a Line is used instead of a Polyline.
  • Added UsedMinLineWidthFactor to get the used minimal line width.
  • Improved Ab2d.Utility.ReaderWmf.ResourceDictionaryWriter - now the process of creating ResourceDictionary from metafiles can be better customized by creating a derived class.
  • Removed obsolete Ab2d.WmfViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.WmfViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

The Paste2Xaml application that can be used to simply copy objects from drawing application and paste them into XAML was also improved - support for the new features of the Ab2d.ReaderWmd library was added.

 

Some of the changes were also made in Ab2d.ReaderSvg library:

  • Markers (arrows and other line endings) are now correctly show on line and polyline elements (before they worked only on path elements).
  • markerWidth and markerHeight attributes are now correctly handled.
  • Removed obsolete Ab2d.SvgViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.SvgViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

 

Now I have to put together the new version of ZoomPanel.

Than a new exciting area awaits - Silverlght 5 with its 3D.

Tags: , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf

New version of Ab2d.ReaderSvg and ViewerSvg

by abenedik 20. August 2010 17:55

The best svg reader for WPF and svg to xaml converter for WPF and Silverlight is now even better.

This release focuses mostly on making work with Ab2d.ReaderSvg easier. Now it is possible to get progress report when reading svg files (there are also two interesting samples about this). It is now easier to use GetXaml method when the read svg file has embedded images. Also the ResourceDictionaryWriter class (helper class to create ResourceDictionaries from svg files) is now greatly improved. With new protected fields and protected virtual methods it is now very customizable.

The reading engine also has some improvements. It fixes some of the special issues that were reported by error reporting in ViewerSvg. The number or error reports is now very low and this tells that the reading engine is already very good and can handle really most of svg files.

The problems with showing the exported xaml in Visual Studio 2010 designer for Silverlight are now gone. With the new version the GetXaml method sets Width and Height to Path element when it is called to create xaml for Silverlight. This is a workaround for a bug in Visual Studio - please vote for the bug on Microsoft Connect so it will be fixed as soon as possible.

The samples have also been updated. There are now a few more samples and they are now available for both Visual Studio 2008 and 2010.

The following is a list of all changes in Ab2d.ReaderSvg:

  • Added ProgressChanged event to ReaderSvg to get report progress when reading file.
  • Improved GetXaml method for Silverlight: Added workaround for displaying Paths in Silverlight in Visual Studio 2010 designer - set Width and Height to Path element.
  • Improved GetXaml method - now the images are written to xaml without need to specify ResolveImagePath delegate. The uri format can be specified with the new DefaultImageUriFormatString property in XamlWritterSettings.
  • Improved reading linked images (not embedded into svg file). Before an exception was thrown when the image file could not be located - now the image object is created but its Source is not set.
  • Fixed reading some svg files with embedded image that reported "Invalid length for a Base-64 char array." error (used custom base64 reader instead of .Net method to read the string).
  • Fixed problems with reading svg files from Microsoft Visio that have more than one layer with the same name defined.
  • Improved ResourceDictionaryWriter class to make it much more customizable. The AddFile and AddStream methods now work correctly. The usedSvgReader, geometrySettings and xamlWritterSettings fields are now protected so they can be changed in derived class. Also the methods CreateReaderSvg, CreateXamlWriterSettings, ReadSvgFile, ReadSvgStream, GetXaml, GetRootResourceKey and ResolveResourceKeyCallback are now protected and virtual so they can be overriden in derived class.
  • Added AddHiddenElements property that specifies if hidden elements are read. If the value of AddHiddenElements is true, than hidden elements are read and have their Visibility property set to Hidden or Collapsed (depends on using display or visibility attribute in svg file).

 

 

As always the ViewerSvg application has also been improved.

As with Paste2Xaml the ViewerSvg can now also change the size of read elements to any custom size. This is not done with only adding a ScaleTransform to the root element (as in previous versions) but now the positions, sizes and other values are changed to fit into the new size.

The improvements in Ab2d.ReaderSvg are also reflected in ViewerSvg. There is now an option to read or skip reading hidden elements. The export dialog also has some new settings - see the following is a screenshot:

ViewerSvg export dialog

 

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , , ,

ReaderSvg