Skip to content
This repository was archived by the owner on Jul 24, 2022. It is now read-only.

Conversation

@z3dev
Copy link
Member

@z3dev z3dev commented May 2, 2018

These changes move the serialize() functions to V2 API ready. The new API is...

serialize (options, ...objects)

In addition, each of the serializers evaluate each object, and only serialize appropriate objects, i.e. CSG and / or CAG.

These changes are now ready for integration into UI for testing.

Tasks

  • rework AMF serializer (API V2, use onml library, multiple CSGs)
  • rework DXF serializer (API V2)
  • rework JSON serializer (API V2, multiple CSG/CAG)
  • rework STL serializer (API V2, multiple CSGs)
  • rework SVG serializer (API V2, muliple CAGs, fixes)
  • rework X3D serializer (API V2, use onml library, multiple CSGs)

All tests both old and new pass.

@z3dev
Copy link
Member Author

z3dev commented May 2, 2018

There's nothing trival about the rework of the IO library, and it is nothing but tedious.

I have complete a first pass on the AMF serialization. Please review for input and output appropriateness, i.e. parameter values and return values. There will be some later changes due to the V2 CSG API, which is still in progress.

Please let me know if you approve or disapprove. I will touch each of the serializers if the changes align with V2 CSG, and V2 applications.

@z3dev z3dev requested review from danmarshall and kaosat-dev May 2, 2018 06:12
@z3dev
Copy link
Member Author

z3dev commented May 2, 2018

@kaosat-dev

A few questions about the AMF serializer changes...

  • I added a dependency for CSG in the package.json. Is that necessary?
  • I added a require() of CSG as well. I don't know why but CSG was not required previously.

@kaosat-dev
Copy link
Contributor

@z3dev a good start , perhaps a bit early

  • good work on amf so far ! I did not even notice how horrible the previous version was :) (seriously, changing the prototype of Vector3D ??)
  • you import what you need: Csg.js was not needed for now , but I can see why you need it now, it is ok and necessary indeed: up until now we where just manipulating the objects directly , without need for helpers from csg.js but given the evolution, it is ok
  • please do not change the version numbers in the packages.json manually . we must NEVER do that !
    it is automated based on commits and this would break things severely !!!

@z3dev
Copy link
Member Author

z3dev commented May 2, 2018

I’ll revert the version numbers to the same as the current releases. Thanks.

Good point on the require(). Probably CSG is not required, just isCSG()

@kaosat-dev
Copy link
Contributor

you still need to import @jscad/csg for isCSG though :)

@z3dev
Copy link
Member Author

z3dev commented May 4, 2018

@drom will appreciate these changes. AMF, SVG, and X3D serializer() functions are now based on the onml library. thanks much!

This eliminates the XMLDOM library forever!!!

@z3dev
Copy link
Member Author

z3dev commented May 6, 2018

STL serialize has been reworked to V2 API, and support the serilization of multiple CSGs to a single STL stream. Tests added as well. Works just fine.

@kaosat-dev This may be a good time to move the new UI to use these changes for V2 API. At this point, the only changes are to the order of parameters to serialize(), which should be easy to change.

@z3dev
Copy link
Member Author

z3dev commented May 7, 2018

In adddition, the UI can pass any combination of objects to the serializers. Only convertible objects are serialized. No more need for union or funny conversions from CAG to CSG, etc.

@kaosat-dev kaosat-dev changed the base branch from master to V2 July 22, 2018 08:23
* changed api slightly to only accept single or arrays of objects
(ie no more serialize(options, obj1, obj2), but only serialize(opts, [obj1, obj2])
* added support for options less calls to the various serialize() functions
* added arrays helper module
* cleanups & tweaks
@kaosat-dev kaosat-dev merged commit 3df021b into V2 Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants