GLB zuwa FBX

Tsarin GLB yana cikin shahararrun tsarin fayil na 3D don yanayin 3D & samfura kuma don ganin su, muna buƙatar amfani da Microsoft Paint 3D, Microsoft Remix 3D, Trimble 3D Warehouse, ko kowane shirin da ke goyan bayan fayilolin glTF. . Amma a gefe guda, Tsarin fayil ɗin PDF yana ɗaya daga cikin tsarin da ake tallafawa don raba bayanai kuma yawancin masu binciken gidan yanar gizo na zamani suna iya nuna fayilolin PDF. Saboda haka, idan aka yi la’akari da wannan sauƙi, a cikin wannan labarin, za mu tattauna cikakkun bayanai kan yadda ake canza GLB zuwa PDF ta amfani da yaren Python da kuma, matakan canza FBX zuwa PDF ta amfani da Python.

3D zuwa PDF Canjin API

Maganin tushen mu na REST mai suna Aspose.3D Cloud yana ba da fasalulluka don samarwa, karantawa, da sarrafa takaddun 3D. Yanzu don amfani da waɗannan fasalulluka a cikin aikace-aikacen Python, muna buƙatar gwada amfani da Aspose.3D Cloud SDK don Python. Don haka mataki na farko shine shigar da SDK wanda ke samuwa don saukewa a PIP da GitHub. Da fatan za a aiwatar da umarni mai zuwa akan tashar layin umarni don shigar da SDK:

pip install aspose3dcloud

Yanzu sami keɓaɓɓen ID na Client ID da ClientSecret cikakkun bayanai ta ziyartar Aspose.Cloud dashboard.

Maida GLB zuwa PDF ta amfani da Python

Da fatan za a bi matakan da aka bayar a ƙasa don loda fayil ɗin GLB daga ma’ajin gajimare da canza shi zuwa tsarin PDF.

  • Ƙirƙiri misali na ThreeDCloudApi yayin wucewa ID na abokin ciniki da sirrin abokin ciniki azaman muhawara
  • Ƙayyade shigar da sunan GLB, tsarin fitarwa azaman PDF da bayanin sunayen fayil na sakamakon
  • A ƙarshe, kira hanyar postconvertbyformat(…) na ajin ThreeDCloudApi don aiwatar da aikin juyawa
# Don ƙarin misalai, da fatan za a ziyarci https://github.com/Aspose-3D-Cloud/aspose-3d-cloud-python

def glbToPdf():
    try:
	client_secret = "1c9379bb7d701c26cc87e741a29987bb"
        client_id = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
	# Ƙirƙiri misali na Aspose.3D Cloud
	threeDCloudApi = aspose3dcloud.ThreeDCloudApi("client_credentials", client_id, client_secret)
		
	# shigar da fayil GLB
	name = "Wolf-Blender-2.82a.glb"
	# Sakamakon fayil ɗin PDF
	newformat = "pdf"
	# sunan resultant PDF file
	newfilename = "Converted.pdf"
	# saita tuta don sake rubuta fayil ɗin da ke akwai
	isOverwrite = "true"
		
	# kiran hanyar API don fara tsarin sauya fayil
	result = threeDCloudApi.post_convert_by_format(name, newformat, newfilename, folder = None, is_overwrite = isOverwrite)
        
	# buga sakon a cikin na'ura mai kwakwalwa (na zaɓi)
	print('Conversion process completed successfully !')
    except ApiException as e:
        print("Exception while calling 3DApi: {0}".format(e))   
glbToPdf()

Maida FBX zuwa PDF ta amfani da Python

Domin canza fayil ɗin FBX da aka adana a cikin ma’ajin gajimare zuwa tsarin PDF kuma ana adana fayil ɗin sakamakon a cikin ma’ajiyar girgije.

  • Ƙirƙiri misali na ThreeDCloudApi yayin wucewa ID na abokin ciniki da sirrin abokin ciniki azaman muhawara
  • Ƙayyade sunan shigar da sunan FBX, tsarin fitarwa azaman PDF da bayanin sunayen fayil na sakamakon
  • Yanzu, kira hanyar postconvertbyformat(…) na ajin ThreeDCloudApi don aiwatar da aikin juyawa
# Don ƙarin misalai, da fatan za a ziyarci https://github.com/Aspose-3D-Cloud/aspose-3d-cloud-python

def fbxToPdf():
    try:
        # Ƙirƙiri misali na Aspose.3D Cloud
	threeDCloudApi  = aspose3dcloud.ThreeDCloudApi("client_credentials", "bbf94a2c-6d7e-4020-b4d2-b9809741374e","1c9379bb7d701c26cc87e741a29987bb")
		
	# shigar da fayil FBX
	name = "Wolf-Blender.fbx"
	# Sakamakon fayil ɗin PDF
	newformat = "pdf"
	# sunan resultant PDF file
	newfilename = "Converted.pdf"
	# saita tuta don sake rubuta fayil ɗin da ke akwai
	isOverwrite = "true"
		
	# fara aiki hira fayil
	result = threeDCloudApi.post_convert_by_format(name, newformat, newfilename, folder = None, is_overwrite = isOverwrite)
        
	# buga saƙo a cikin na'ura mai kwakwalwa (na zaɓi)
	print('Conversion process completed successfully !')
    except ApiException as e:
	print("Exception while calling 3DApi: {0}".format(e))   
	
fbxToPdf()

Za a iya sauke samfurin fayilolin da aka yi amfani da su a cikin misalan sama daga Wolf-Blender-2.82a.glb da Wolf-Blender-Converted.fbx.

GLB zuwa PDF ta amfani da Umurnin CURL

Aspose.3D Cloud an ƙera shi kamar yadda REST gine, don haka a cikin wannan sashe, za mu koyi matakai don canza GLB zuwa PDF ta amfani da umarnin cURL. Koyaya, matakin farko na wannan tsari shine ƙirƙirar alamar samun damar JWT dangane da shaidar abokin cinikin ku. Da fatan za a aiwatar da umarni mai zuwa don samar da alamar.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Da zarar mun sami alamar JWT, muna buƙatar aiwatar da wannan umarni don musanya GLB zuwa tsarin PDF.

curl -v -X POST "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Wolf-Blender-2.82a(2).glb&newformat=PDF&newfilename=Converted.pdf&IsOverwrite=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>" \
-d{}

FBX zuwa PDF ta amfani da Umurnin CURL

Da fatan za a aiwatar da umarni mai zuwa don loda fayil ɗin FBX daga ma’ajiyar girgije kuma canza shi zuwa tsarin PDF. Ana ajiye sakamakon fayil ɗin zuwa ma’ajiyar gajimare.

curl -v -X POST "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Wolf-Blender-Converted(1).fbx&newformat=PDF&newfilename=Converted.pdf&IsOverwrite=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>" \
-d{}

Kammalawa

A cikin wannan labarin, mun bincika cikakkun bayanai don canza 3D zuwa PDF, GLB zuwa PDF da FBX zuwa PDF ta amfani da snippets code na Python. A lokaci guda, mun kuma koyi matakan canza FBX zuwa PDF ta amfani da snippet code na Python. Haɓaka 3D PDF maker ta bin matakan da muke canza GLB da FBX zuwa PDF ta amfani da umarnin cURL. Bugu da ƙari, API ɗin yana ba da fasalin don canza FBX zuwa OBJ, OBJ zuwa FBX, ko adana FBX zuwa tsarin STL. Yi amfani da API don canza samfurin ku Mercedes glb ko glb 250 da sauransu fayiloli zuwa tsarin fitarwa da ake so.

Lura cewa Jagorar Haɓaka babban tushen bayanai ne don koyo game da iyakoki masu ban mamaki da SDK ke bayarwa. Idan kun haɗu da kowace matsala yayin amfani da API, da fatan za a tuntuɓe mu ta [ dandalin tallafi na kyauta 11.

Labarai masu alaka

Muna kuma ba ku shawarar ku ziyarci hanyar haɗin yanar gizon don ƙarin koyo game da: